[
  {
    "path": "005/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "005/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "005/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "005/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "005/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "005/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "005/src/App.js",
    "content": "const App = () => {\r\n    return (\r\n        <h1>Hello!</h1>\r\n    );\r\n}\r\n\r\nexport default App;"
  },
  {
    "path": "005/src/index.css",
    "content": "h1{\r\n    font-size: 100px;\r\n}"
  },
  {
    "path": "005/src/index.js",
    "content": "import React from \"react\";\r\nimport ReactDOM from \"react-dom/client\";\r\n\r\nimport App from \"./App\";\r\nimport \"./index.css\";\r\n\r\nconst root = ReactDOM.createRoot(document.getElementById(\"root\"));\r\nroot.render(\r\n    <React.StrictMode>\r\n        <App />\r\n    </React.StrictMode>\r\n);"
  },
  {
    "path": "006/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "006/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "006/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "006/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "006/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "006/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "006/src/App.css",
    "content": ""
  },
  {
    "path": "006/src/App.js",
    "content": "import './App.css';\n\nexport default function App() {\n  return (\n    <div>App</div>\n  )\n}\n"
  },
  {
    "path": "006/src/index.css",
    "content": ""
  },
  {
    "path": "006/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "007/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "007/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "007/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "007/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "007/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "007/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "007/src/App.css",
    "content": ".active{\r\n    font-size: 50px;\r\n}"
  },
  {
    "path": "007/src/App.js",
    "content": "// import React from 'react';\nimport './App.css';\n\nexport default function App() {\n  const username = \"Shubham\";\n\n  return (\n    <div>\n      <h1 className='active'>{username}</h1>\n      <p>Lorem ipsum dolor, placeat.</p>\n    </div>\n  )\n\n  // return React.createElement(\"h1\", {className: \"active\"}, \"Shubham\")\n}"
  },
  {
    "path": "007/src/index.css",
    "content": ""
  },
  {
    "path": "007/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "008/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "008/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "008/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "008/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "008/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "008/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "008/src/App.css",
    "content": ".active{\r\n    font-size: 50px;\r\n}\r\n\r\n"
  },
  {
    "path": "008/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport './App.css';\n\nexport default function App() {\n  return (\n    <>\n      <Header />\n      <div>\n        <h1>Shubham</h1>\n      </div>\n      <Footer />\n    </>\n  )\n}"
  },
  {
    "path": "008/src/components/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <div>Footer</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "008/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <div>\r\n        <img className=\"logo\" src={Logo} alt=\"\" />\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "008/src/components/header.css",
    "content": ".logo{\r\n    height: 80px;\r\n}"
  },
  {
    "path": "008/src/index.css",
    "content": ""
  },
  {
    "path": "008/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "009/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "009/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "009/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "009/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "009/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "009/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "009/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.box{\n  max-width: 200px;\n  margin: 50px auto;\n  border-radius: 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 10px;\n}\n\np{\n  margin-top: 20px;\n  font-size: 24px;\n  text-align: center;\n}\n\nbutton{\n  padding: 10px;\n  margin: 20px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n}\n\nbutton.add{\n  background-color: #18978F;\n}\n\nbutton.sub{\n  background-color: #EB4747;\n}\n\nbutton.reset{\n  background-color: #0F3460;\n}"
  },
  {
    "path": "009/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  let count = 0;\n\n  function handleAdd(){\n    count+=1;\n    console.log(count);\n  }\n\n  return (\n    <div className=\"App\">\n      <div className=\"box\">\n        <p>{count}</p>\n        <button onClick={handleAdd} className='add'>ADD</button>\n        <button className='sub'>SUB</button>\n      </div>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "009/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "009/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "010/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "010/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "010/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "010/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "010/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "010/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "010/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.box{\n  max-width: 200px;\n  margin: 50px auto;\n  border-radius: 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 10px;\n}\n\np{\n  margin-top: 20px;\n  font-size: 24px;\n  text-align: center;\n}\n\nbutton{\n  padding: 10px;\n  margin: 20px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n}\n\nbutton.add{\n  background-color: #18978F;\n}\n\nbutton.sub{\n  background-color: #EB4747;\n}\n\nbutton.reset{\n  background-color: #0F3460;\n}"
  },
  {
    "path": "010/src/App.js",
    "content": "import { useState } from 'react';\nimport './App.css';\n\nfunction App() {\n  const [count, setCount] = useState(0);\n\n  function handleAdd(){\n    setCount(count + 1);\n  }\n\n  function handleSub(){\n    setCount(count - 1);\n  }\n\n  function handleReset(){\n    setCount(0);\n  }\n\n  return (\n    <div className=\"App\">\n      <div className=\"box\">\n        <p>{count}</p>\n        <button onClick={handleAdd} className='add'>ADD</button>\n        <button onClick={handleSub} className='sub'>SUB</button>\n        <button onClick={handleReset} className='reset'>RESET</button>\n      </div>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "010/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "010/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "011/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "011/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "011/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "011/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "011/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "011/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "011/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.box{\n  max-width: 200px;\n  margin: 50px auto;\n  border-radius: 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 10px;\n}\n\np{\n  margin-top: 20px;\n  font-size: 24px;\n  text-align: center;\n}\n\nbutton{\n  padding: 10px;\n  margin: 20px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n}\n\nbutton.add{\n  background-color: #18978F;\n}\n\nbutton.sub{\n  background-color: #EB4747;\n}\n\nbutton.reset{\n  background-color: #0F3460;\n}"
  },
  {
    "path": "011/src/App.js",
    "content": "import { useState } from 'react';\nimport './App.css';\n\nfunction App() {\n  const [count, setCount] = useState(0);\n\n  function handleAdd(){\n    setCount(count => count + 1);\n    setCount(count => count + 1);\n    setCount(count => count + 1);\n  }\n\n  function handleSub(){\n    setCount(count - 1);\n  }\n\n  function handleReset(){\n    setCount(0);\n  }\n\n  return (\n    <div className=\"App\">\n      <div className=\"box\">\n        <p>{count}</p>\n        <button onClick={handleAdd} className='add'>ADD</button>\n        <button onClick={handleSub} className='sub'>SUB</button>\n        <button onClick={handleReset} className='reset'>RESET</button>\n      </div>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "011/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "011/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "012/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "012/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "012/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "012/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "012/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "012/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "012/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "012/src/App.js",
    "content": "import { useState } from 'react';\nimport './App.css';\n\nfunction App() {\n  const [tasks, setTasks] = useState([\n    {id: 5271, name: \"Record React Lectures\", completed: true}, \n    {id: 7825, name: \"Edit React Lectures\", completed: false}, \n    {id: 8391, name: \"Watch Lectures\", completed: false}\n  ]);\n\n  return (\n    <div className=\"App\">\n      <h1>Task List</h1>\n      <ul>\n        { tasks.map((task) => (\n          <li key={task.id}>\n            <span>{task.id} - {task.name}</span>\n            <button className='delete'>Delete</button>\n          </li>\n        )) }\n      </ul>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "012/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "012/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "013/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "013/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "013/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "013/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "013/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "013/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "013/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "013/src/App.js",
    "content": "import { useState } from 'react';\nimport './App.css';\n\nfunction App() {\n  const [tasks, setTasks] = useState([\n    {id: 5271, name: \"Record React Lectures\", completed: true}, \n    {id: 7825, name: \"Edit React Lectures\", completed: false}, \n    {id: 8391, name: \"Watch Lectures\", completed: false}\n  ]);\n\n  function handleDelete(id){\n    setTasks(tasks.filter(task => task.id !== id));\n  }\n\n  return (\n    <div className=\"App\">\n      <h1>Task List</h1>\n      <ul>\n        { tasks.map((task) => (\n          <li key={task.id}>\n            <span>{task.id} - {task.name}</span>\n            <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\n          </li>\n        )) }\n      </ul>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "013/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "013/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "014/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "014/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "014/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "014/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "014/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "014/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "014/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "014/src/App.js",
    "content": "import { useState } from 'react';\nimport './App.css';\n\nfunction App() {\n  const [tasks, setTasks] = useState([\n    {id: 5271, name: \"Record React Lectures\", completed: true}, \n    {id: 7825, name: \"Edit React Lectures\", completed: false}, \n    {id: 8391, name: \"Watch Lectures\", completed: false}\n  ]);\n  const [show, setShow] = useState(true);\n\n  function handleDelete(id){\n    setTasks(tasks.filter(task => task.id !== id));\n  }\n\n  return (\n    <div className=\"App\">\n      <h1>Task List</h1>\n      <ul>\n        <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\n        { show && tasks.map((task) => (\n          <li key={task.id} className={task.completed ? \"completed\" : \"incomplete\"}>\n            <span>{task.id} - {task.name}</span>\n            <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\n          </li>\n        )) }\n      </ul>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "014/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "014/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "015/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "015/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "015/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "015/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "015/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "015/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "015/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "015/src/App.js",
    "content": "import { useState } from 'react';\nimport './App.css';\n\nfunction App() {\n  const [tasks, setTasks] = useState([\n    {id: 5271, name: \"Record React Lectures\", completed: true}, \n    {id: 7825, name: \"Edit React Lectures\", completed: false}, \n    {id: 8391, name: \"Watch Lectures\", completed: false}\n  ]);\n  const [show, setShow] = useState(true);\n\n  function handleDelete(id){\n    setTasks(tasks.filter(task => task.id !== id));\n  }\n\n  return (\n    <div className=\"App\">\n      <h1>Task List</h1>\n      <ul>\n        <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\n        { show && tasks.map((task) => (\n          <li key={task.id} className={task.completed ? \"completed\" : \"incomplete\"}>\n            <span>{task.id} - {task.name}</span>\n            <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\n          </li>\n        )) }\n      </ul>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "015/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "015/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "016/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "016/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "016/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "016/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "016/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "016/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "016/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "016/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "016/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "016/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <>\r\n        <h1>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\r\n            { show && tasks.map((task) => (\r\n                <li key={task.id} className={task.completed ? \"completed\" : \"incomplete\"}>\r\n                    <span>{task.id} - {task.name}</span>\r\n                    <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n                </li>\r\n            )) }\r\n        </ul>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "016/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "016/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "017/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "017/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "017/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "017/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "017/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "017/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "017/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "017/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "017/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "017/src/components/TaskCard.js",
    "content": "export const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <li className={task.completed ? \"completed\" : \"incomplete\"}>\r\n        <span>{task.id} - {task.name}</span>\r\n        <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n    </li>\r\n  )\r\n}\r\n"
  },
  {
    "path": "017/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <>\r\n        <h1>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "017/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "017/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "018/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "018/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "018/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "018/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "018/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "018/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "018/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "018/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "018/src/components/BoxCard.js",
    "content": "import { useState } from \"react\"\r\n\r\nexport const BoxCard = ({result, children}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    return (\r\n        <div className={show ? \"\" : \"hidden\"}>\r\n            <div className={`box ${result}`}>\r\n                {children}\r\n                <button onClick={() => setShow(!show)} className=\"trigger\">Hide</button>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "018/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "018/src/components/TaskCard.js",
    "content": "export const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <li className={task.completed ? \"completed\" : \"incomplete\"}>\r\n        <span>{task.id} - {task.name}</span>\r\n        <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n    </li>\r\n  )\r\n}\r\n"
  },
  {
    "path": "018/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport { BoxCard } from './BoxCard';\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <>\r\n        <h1>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n        <BoxCard result=\"success\">\r\n            <p className=\"title\">Lorem ipsum dolor sit amet.</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, vel!</p>\r\n        </BoxCard>\r\n\r\n        <BoxCard result=\"warning\">\r\n            <p className=\"title\">Lorem ipsum dolor sit.</p>\r\n            <p className=\"description\">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet, eum odit! Labore eaque fuga repellat adipisci molestias quasi animi fugiat necessitatibus sunt vel, optio rem non quidem! Blanditiis cupiditate iusto omnis reprehenderit assumenda maxime, nam perferendis impedit libero odit eius eum aut cum ad, excepturi officiis repudiandae. Molestiae, eum cumque?</p>\r\n            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusamus, nulla?</p>\r\n        </BoxCard>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "018/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "018/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "019/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "019/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "019/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "019/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "019/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "019/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "019/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nh1{\n  font-size: 28px;\n  text-align: center;\n  margin: 20px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  height: 50px;\n  align-items: center;\n  max-width: 1000px;\n  margin: auto;\n  border-bottom: 1px solid #d7d7d7;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\nimg{\n  max-width: 40px;\n}\n\nul{\n  max-width: 600px;\n  margin: 50px auto;\n  padding: 20px;\n  box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\n}\n\nli{\n  font: 16px;\n  list-style: none;\n  margin: 20px 5px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  padding: 10px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\nli.completed{\n  box-shadow: rgb(62, 150, 0) 0px 1px 4px;\n}\n\nli.incomplete{\n  box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\n}\n\nbutton.delete{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #be3434;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\nbutton.trigger{\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0F3460;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.box{\n  width: 400px;\n  margin: 20px auto;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  padding: 20px 5px;\n  border: 0px;\n  border-radius: 5px;\n}\n\n.box.success{\n  background-color: #baffbf;\n}\n\n.box.alert{\n  background-color: #ffb4b4;\n}\n\n.box.warning{\n  background-color: #FFDEB4;\n}\n\n.box p{\n  margin: 10px;\n}\n\n.box p.title{\n  font-size: 20px;\n}\n\n.box p.description{\n  font-size: 14px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "019/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n  const concept = \"Prop Drilling\";\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList concept={concept} />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "019/src/components/BoxCard.js",
    "content": "import { useState } from \"react\"\r\n\r\nexport const BoxCard = ({result, children}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    return (\r\n        <div className={show ? \"\" : \"hidden\"}>\r\n            <div className={`box ${result}`}>\r\n                {children}\r\n                <button onClick={() => setShow(!show)} className=\"trigger\">Hide</button>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "019/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "019/src/components/TaskCard.js",
    "content": "export const TaskCard = ({ task, handleDelete, concept }) => {\r\n  return (\r\n    <li className={task.completed ? \"completed\" : \"incomplete\"}>\r\n        <span>{task.id} - {task.name} - {concept}</span>\r\n        <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n    </li>\r\n  )\r\n}\r\n"
  },
  {
    "path": "019/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport { BoxCard } from './BoxCard';\r\n\r\nexport const TaskList = ({concept}) => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <>\r\n        <h1>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} concept={concept} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n        <BoxCard result=\"success\">\r\n            <p className=\"title\">Lorem ipsum dolor sit amet.</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, vel!</p>\r\n        </BoxCard>\r\n\r\n        <BoxCard result=\"warning\">\r\n            <p className=\"title\">Lorem ipsum dolor sit.</p>\r\n            <p className=\"description\">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet, eum odit! Labore eaque fuga repellat adipisci molestias quasi animi fugiat necessitatibus sunt vel, optio rem non quidem! Blanditiis cupiditate iusto omnis reprehenderit assumenda maxime, nam perferendis impedit libero odit eius eum aut cum ad, excepturi officiis repudiandae. Molestiae, eum cumque?</p>\r\n            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusamus, nulla?</p>\r\n        </BoxCard>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "019/src/index.css",
    "content": "*{\n  font-family: Arial, Helvetica, sans-serif;\n  margin: 0px;\n  padding: 0px;\n}"
  },
  {
    "path": "019/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "020/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "021/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "021/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "021/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "021/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "021/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "021/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "021/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "021/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "021/src/components/BoxCard.css",
    "content": ".box {\r\n    max-width: 600px;\r\n    margin: 20px auto;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    padding: 20px 5px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.box.success {\r\n    background-color: #baffbf;\r\n}\r\n\r\n.box.alert {\r\n    background-color: #ffb4b4;\r\n}\r\n\r\n.box.warning {\r\n    background-color: #FFDEB4;\r\n}\r\n\r\n.box p {\r\n    margin: 10px;\r\n}\r\n\r\n.box p.title {\r\n    font-size: 20px;\r\n}\r\n\r\n.box p.description {\r\n    font-size: 14px;\r\n}\r\n\r\n.box button{\r\n    width: 300px;\r\n    margin-top: 20px;\r\n}"
  },
  {
    "path": "021/src/components/BoxCard.js",
    "content": "import { useState } from \"react\"\r\nimport \"./BoxCard.css\";\r\n\r\nexport const BoxCard = ({result, children}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    return (\r\n        <div className={show ? \"\" : \"hidden\"}>\r\n            <div className={`box ${result}`}>\r\n                {children}\r\n                <button onClick={() => setShow(!show)} className=\"trigger\">Hide</button>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "021/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    border-top: 1px solid var(--theme-border);\r\n  }"
  },
  {
    "path": "021/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "021/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 50px;\r\n    align-items: center;\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 18px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 40px;\r\n}"
  },
  {
    "path": "021/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "021/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font: 16px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "021/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "021/src/components/TaskList.css",
    "content": ".tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n    margin: 20px;\r\n}\r\n\r\n.tasklist ul{\r\n    max-width: 600px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "021/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport { BoxCard } from './BoxCard';\r\nimport \"./TaskList.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <h1>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n        <BoxCard result=\"success\">\r\n            <p className=\"title\">Offer Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, vel!</p>\r\n        </BoxCard>\r\n\r\n        <BoxCard result=\"warning\">\r\n            <p className=\"title\">Cookie Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi, suscipit.</p>\r\n        </BoxCard>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "021/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "021/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "022/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "022/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "022/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "022/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "022/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "022/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "022/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "022/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "022/src/components/BoxCard.css",
    "content": ".box {\r\n    max-width: 600px;\r\n    margin: 20px auto;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    padding: 20px 5px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.box.success {\r\n    background-color: #baffbf;\r\n}\r\n\r\n.box.alert {\r\n    background-color: #ffb4b4;\r\n}\r\n\r\n.box.warning {\r\n    background-color: #FFDEB4;\r\n}\r\n\r\n.box p {\r\n    margin: 10px;\r\n}\r\n\r\n.box p.title {\r\n    font-size: 20px;\r\n}\r\n\r\n.box p.description {\r\n    font-size: 14px;\r\n}\r\n\r\n.box button{\r\n    width: 300px;\r\n    margin-top: 20px;\r\n}"
  },
  {
    "path": "022/src/components/BoxCard.js",
    "content": "import { useState } from \"react\"\r\nimport \"./BoxCard.css\";\r\n\r\nexport const BoxCard = ({result, children}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    return (\r\n        <div className={show ? \"\" : \"hidden\"}>\r\n            <div className={`box ${result}`}>\r\n                {children}\r\n                <button onClick={() => setShow(!show)} className=\"trigger\">Hide</button>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "022/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    border-top: 1px solid var(--theme-border);\r\n  }"
  },
  {
    "path": "022/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "022/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 50px;\r\n    align-items: center;\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 18px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 40px;\r\n}"
  },
  {
    "path": "022/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "022/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font: 16px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "022/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "022/src/components/TaskList.css",
    "content": ".tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n    margin: 20px;\r\n}\r\n\r\n.tasklist ul{\r\n    max-width: 600px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "022/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport { BoxCard } from './BoxCard';\r\nimport \"./TaskList.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n    const styles = {\r\n        color: \"#be3434\",\r\n        border: \"1px solid #be3434\", \r\n        borderRadius: \"5px\",\r\n        padding: \"20px\"\r\n    }\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <h1 style={styles}>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>Toggle</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n        <BoxCard result=\"success\">\r\n            <p className=\"title\">Offer Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, vel!</p>\r\n        </BoxCard>\r\n\r\n        <BoxCard result=\"warning\">\r\n            <p className=\"title\">Cookie Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi, suscipit.</p>\r\n        </BoxCard>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "022/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "022/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "023/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "023/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "023/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "023/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "023/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "023/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "023/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "023/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "023/src/components/BoxCard.css",
    "content": ".box {\r\n    max-width: 600px;\r\n    margin: 20px auto;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    padding: 20px 5px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.box.success {\r\n    background-color: #baffbf;\r\n}\r\n\r\n.box.alert {\r\n    background-color: #ffb4b4;\r\n}\r\n\r\n.box.warning {\r\n    background-color: #FFDEB4;\r\n}\r\n\r\n.box p {\r\n    margin: 10px;\r\n}\r\n\r\n.box p.title {\r\n    font-size: 20px;\r\n}\r\n\r\n.box p.description {\r\n    font-size: 14px;\r\n}\r\n\r\n.box button{\r\n    width: 300px;\r\n    margin-top: 20px;\r\n}"
  },
  {
    "path": "023/src/components/BoxCard.js",
    "content": "import { useState } from \"react\"\r\nimport \"./BoxCard.css\";\r\n\r\nexport const BoxCard = ({result, children}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    return (\r\n        <div className={show ? \"\" : \"hidden\"}>\r\n            <div className={`box ${result}`}>\r\n                {children}\r\n                <button onClick={() => setShow(!show)} className=\"trigger\">Hide</button>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "023/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    border-top: 1px solid var(--theme-border);\r\n  }"
  },
  {
    "path": "023/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "023/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 50px;\r\n    align-items: center;\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 18px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 40px;\r\n}"
  },
  {
    "path": "023/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "023/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font: 16px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "023/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "023/src/components/TaskList.css",
    "content": ".tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n    margin: 20px;\r\n}\r\n\r\n.tasklist ul{\r\n    max-width: 600px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "023/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport { BoxCard } from './BoxCard';\r\nimport \"./TaskList.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n    const styles = {\r\n        color: show ? \"#3D8361\" : \"#be3434\",\r\n        border: \"2px solid\", \r\n        borderColor: show ? \"#3D8361\" : \"#be3434\" ,\r\n        borderRadius: \"5px\",\r\n        fontSize: \"28px\",\r\n        padding: \"20px\"\r\n    }\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <h1 style={styles}>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide\" : \"Show\"}</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n        <BoxCard result=\"success\">\r\n            <p className=\"title\">Offer Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, vel!</p>\r\n        </BoxCard>\r\n\r\n        <BoxCard result=\"warning\">\r\n            <p className=\"title\">Cookie Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi, suscipit.</p>\r\n        </BoxCard>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "023/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "023/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "024/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "024/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "024/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "024/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "024/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "024/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "024/src/App.css",
    "content": ".App{\n  text-align: center;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "024/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "024/src/components/BoxCard.css",
    "content": ".box {\r\n    max-width: 600px;\r\n    margin: 20px auto;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    padding: 20px 5px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.box.success {\r\n    background-color: #baffbf;\r\n}\r\n\r\n.box.alert {\r\n    background-color: #ffb4b4;\r\n}\r\n\r\n.box.warning {\r\n    background-color: #FFDEB4;\r\n}\r\n\r\n.box p {\r\n    margin: 10px;\r\n}\r\n\r\n.box p.title {\r\n    font-size: 20px;\r\n}\r\n\r\n.box p.description {\r\n    font-size: 14px;\r\n}\r\n\r\n.box button{\r\n    width: 300px;\r\n    margin-top: 20px;\r\n}"
  },
  {
    "path": "024/src/components/BoxCard.js",
    "content": "import { useState } from \"react\"\r\nimport \"./BoxCard.css\";\r\n\r\nexport const BoxCard = ({result, children}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    return (\r\n        <div className={show ? \"\" : \"hidden\"}>\r\n            <div className={`box ${result}`}>\r\n                {children}\r\n                <button onClick={() => setShow(!show)} className=\"trigger\">Hide</button>\r\n            </div>\r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "024/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    border-top: 1px solid var(--theme-border);\r\n  }"
  },
  {
    "path": "024/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "024/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 50px;\r\n    align-items: center;\r\n    max-width: 1000px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 18px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 40px;\r\n}"
  },
  {
    "path": "024/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a className=\"title\" href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "024/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font: 16px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "024/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\nimport styles from \"./TaskCard.module.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span className={styles.title}>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "024/src/components/TaskCard.module.css",
    "content": ".title{\r\n    background-color: rgb(142, 189, 255);\r\n}\r\n\r\n#random{\r\n    background-color: rgb(142, 189, 255);\r\n}"
  },
  {
    "path": "024/src/components/TaskList.css",
    "content": ".tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n    margin: 20px;\r\n}\r\n\r\n.tasklist ul{\r\n    max-width: 600px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "024/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport { BoxCard } from './BoxCard';\r\nimport \"./TaskList.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n    const styles = {\r\n        color: show ? \"#3D8361\" : \"#be3434\",\r\n        border: \"2px solid\", \r\n        borderColor: show ? \"#3D8361\" : \"#be3434\" ,\r\n        borderRadius: \"5px\",\r\n        fontSize: \"28px\",\r\n        padding: \"20px\"\r\n    }\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <h1 style={styles}>Task List</h1>\r\n        <ul>\r\n            <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide\" : \"Show\"}</button>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n        <BoxCard result=\"success\">\r\n            <p className=\"title\">Offer Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Perferendis, vel!</p>\r\n        </BoxCard>\r\n\r\n        <BoxCard result=\"warning\">\r\n            <p className=\"title\">Cookie Notification</p>\r\n            <p className=\"description\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi, suscipit.</p>\r\n        </BoxCard>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "024/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "024/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "025/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "025/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "025/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "025/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "025/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "025/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "025/src/App.css",
    "content": ".App{\n  text-align: center;\n  padding: 0px 10px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "025/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "025/src/components/AddTask.css",
    "content": ".addtask{\r\n    max-width: 800px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.addtask form{\r\n    display: flex;\r\n    justify-content: space-around;\r\n    align-items: center;\r\n    flex-wrap: wrap;\r\n}\r\n\r\n.addtask label{\r\n    font-size: 20px;\r\n    margin-right: 5px;\r\n}\r\n\r\n.addtask input{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border: 1px solid #878787;\r\n    border-radius: 5px;\r\n    flex-grow: 1;\r\n    margin: 10px;\r\n}\r\n\r\n.addtask input:focus{\r\n    outline: none;\r\n}\r\n\r\n.addtask select{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    cursor: pointer;\r\n}\r\n\r\n.addtask button{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n}"
  },
  {
    "path": "025/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    height: 70px;\r\n    font-size: 18px;\r\n    border-top: 1px solid var(--theme-border);\r\n}"
  },
  {
    "path": "025/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "025/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 20px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 45px;\r\n}"
  },
  {
    "path": "025/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "025/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font-size: 20px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "025/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "025/src/components/TaskList.css",
    "content": ".tasklist ul{\r\n    max-width: 800px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.tasklist .header{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 20px 10px;\r\n    margin-bottom: 30px;\r\n}\r\n\r\n.tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n    font-size: 16px;\r\n}"
  },
  {
    "path": "025/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport \"./TaskList.css\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <ul>\r\n            <div className='header'>\r\n                <h1>TaskList</h1>\r\n                <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide Tasks\" : \"Show Tasks\"}</button>\r\n            </div>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "025/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "025/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "026/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "026/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "026/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "026/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "026/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "026/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "026/src/App.css",
    "content": ".App{\n  text-align: center;\n  padding: 0px 10px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "026/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport { AddTask } from \"./components/AddTask\";\n\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "026/src/components/AddTask.css",
    "content": ".addtask{\r\n    max-width: 800px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.addtask form{\r\n    display: flex;\r\n    justify-content: space-around;\r\n    align-items: center;\r\n    flex-wrap: wrap;\r\n}\r\n\r\n.addtask label{\r\n    font-size: 20px;\r\n    margin-right: 5px;\r\n}\r\n\r\n.addtask input{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border: 1px solid #878787;\r\n    border-radius: 5px;\r\n    flex-grow: 1;\r\n    margin: 10px;\r\n}\r\n\r\n.addtask input:focus{\r\n    outline: none;\r\n}\r\n\r\n.addtask select{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    cursor: pointer;\r\n}\r\n\r\n.addtask button{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #129762;\r\n}"
  },
  {
    "path": "026/src/components/AddTask.js",
    "content": "import { useState } from \"react\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const AddTask = () => {\r\n    const [taskValue, setTaskValue] = useState(\"\");\r\n\r\n    // const handleChange = (event) => {\r\n    //     setTaskValue(event.target.value);\r\n    // }\r\n\r\n  return (\r\n    <section className=\"addtask\">\r\n        <form>\r\n            <input onChange={(e) => setTaskValue(e.target.value)} type=\"text\" name=\"task\" id=\"task\" placeholder=\"Task Name\" autoComplete=\"off\" />\r\n            <button type=\"submit\">Add Task</button>\r\n        </form>\r\n        {/* <p>{taskValue.length}</p> */}\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "026/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    height: 70px;\r\n    font-size: 18px;\r\n    border-top: 1px solid var(--theme-border);\r\n}"
  },
  {
    "path": "026/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "026/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 20px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 45px;\r\n}"
  },
  {
    "path": "026/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "026/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font-size: 20px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "026/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "026/src/components/TaskList.css",
    "content": ".tasklist ul{\r\n    max-width: 800px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.tasklist .header{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 20px 10px;\r\n    margin-bottom: 30px;\r\n}\r\n\r\n.tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n    font-size: 16px;\r\n}"
  },
  {
    "path": "026/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport \"./TaskList.css\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <ul>\r\n            <div className='header'>\r\n                <h1>TaskList</h1>\r\n                <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide Tasks\" : \"Show Tasks\"}</button>\r\n            </div>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "026/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "026/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "027/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "027/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "027/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "027/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "027/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "027/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "027/src/App.css",
    "content": ".App{\n  text-align: center;\n  padding: 0px 10px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "027/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport { AddTask } from \"./components/AddTask\";\n\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "027/src/components/AddTask.css",
    "content": ".addtask{\r\n    max-width: 800px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.addtask form{\r\n    display: flex;\r\n    justify-content: space-around;\r\n    align-items: center;\r\n    flex-wrap: wrap;\r\n}\r\n\r\n.addtask label{\r\n    font-size: 20px;\r\n    margin-right: 5px;\r\n}\r\n\r\n.addtask input{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border: 1px solid #878787;\r\n    border-radius: 5px;\r\n    flex-grow: 1;\r\n    margin: 10px;\r\n}\r\n\r\n.addtask input:focus{\r\n    outline: none;\r\n}\r\n\r\n.addtask select{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    cursor: pointer;\r\n}\r\n\r\n.addtask button{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #129762;\r\n}\r\n\r\n.addtask .reset{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    border-radius: 5px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "027/src/components/AddTask.js",
    "content": "import { useState } from \"react\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const AddTask = () => {\r\n    const [taskValue, setTaskValue] = useState(\"\");\r\n\r\n    const handleChange = (event) => {\r\n        setTaskValue(event.target.value);\r\n    }\r\n\r\n    const handleReset = () => {\r\n        setTaskValue(\"\");\r\n    }\r\n\r\n  return (\r\n    <section className=\"addtask\">\r\n        <form>\r\n            <input onChange={handleChange} type=\"text\" name=\"task\" id=\"task\" placeholder=\"Task Name\" autoComplete=\"off\" value={taskValue} />\r\n            <button type=\"submit\">Add Task</button>\r\n            <span onClick={handleReset} className=\"reset\">Reset</span>\r\n        </form>\r\n        <p>{taskValue}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "027/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    height: 70px;\r\n    font-size: 18px;\r\n    border-top: 1px solid var(--theme-border);\r\n}"
  },
  {
    "path": "027/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "027/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 20px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 45px;\r\n}"
  },
  {
    "path": "027/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "027/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font-size: 20px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "027/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "027/src/components/TaskList.css",
    "content": ".tasklist ul{\r\n    max-width: 800px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.tasklist .header{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 20px 10px;\r\n    margin-bottom: 30px;\r\n}\r\n\r\n.tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n    font-size: 16px;\r\n}"
  },
  {
    "path": "027/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport \"./TaskList.css\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <ul>\r\n            <div className='header'>\r\n                <h1>TaskList</h1>\r\n                <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide Tasks\" : \"Show Tasks\"}</button>\r\n            </div>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "027/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "027/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "028/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "028/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "028/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "028/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "028/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "028/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "028/src/App.css",
    "content": ".App{\n  text-align: center;\n  padding: 0px 10px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "028/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport { AddTask } from \"./components/AddTask\";\n\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask />\n      <TaskList />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "028/src/components/AddTask.css",
    "content": ".addtask{\r\n    max-width: 800px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.addtask form{\r\n    display: flex;\r\n    justify-content: space-around;\r\n    align-items: center;\r\n    flex-wrap: wrap;\r\n}\r\n\r\n.addtask label{\r\n    font-size: 20px;\r\n    margin-right: 5px;\r\n}\r\n\r\n.addtask input{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border: 1px solid #878787;\r\n    border-radius: 5px;\r\n    flex-grow: 1;\r\n    margin: 10px;\r\n}\r\n\r\n.addtask input:focus{\r\n    outline: none;\r\n}\r\n\r\n.addtask select{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    cursor: pointer;\r\n}\r\n\r\n.addtask button{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #129762;\r\n}\r\n\r\n.addtask .reset{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    border-radius: 5px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "028/src/components/AddTask.js",
    "content": "import { useState } from \"react\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const AddTask = () => {\r\n    const [taskValue, setTaskValue] = useState(\"\");\r\n    const [progress, setProgress] = useState(false);\r\n\r\n    const handleChange = (event) => {\r\n        setTaskValue(event.target.value);\r\n    }\r\n\r\n    const handleReset = () => {\r\n        setTaskValue(\"\");\r\n        setProgress(false);\r\n    }\r\n\r\n    const handleSubmit = (event) => {\r\n        event.preventDefault();\r\n        const task = {\r\n            id: Math.floor(Math.random() * 10000),\r\n            name: taskValue,\r\n            completed: Boolean(progress)\r\n        }\r\n        handleReset();\r\n    }\r\n\r\n  return (\r\n    <section className=\"addtask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input onChange={handleChange} type=\"text\" name=\"task\" id=\"task\" placeholder=\"Task Name\" autoComplete=\"off\" value={taskValue} />\r\n            <select onChange={(event) => setProgress(event.target.value)} value={progress}>\r\n                <option value=\"false\">Pending</option>\r\n                <option value=\"true\">Completed</option>\r\n            </select>\r\n            <span onClick={handleReset} className=\"reset\">Reset</span>\r\n            <button type=\"submit\">Add Task</button>\r\n        </form>\r\n        <p>{taskValue}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "028/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    height: 70px;\r\n    font-size: 18px;\r\n    border-top: 1px solid var(--theme-border);\r\n}"
  },
  {
    "path": "028/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "028/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 20px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 45px;\r\n}"
  },
  {
    "path": "028/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "028/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font-size: 20px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "028/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "028/src/components/TaskList.css",
    "content": ".tasklist ul{\r\n    max-width: 800px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.tasklist .header{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 20px 10px;\r\n    margin-bottom: 30px;\r\n}\r\n\r\n.tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n    font-size: 16px;\r\n}"
  },
  {
    "path": "028/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport \"./TaskList.css\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const TaskList = () => {\r\n    const [tasks, setTasks] = useState([\r\n        {id: 5271, name: \"Record React Lectures\", completed: true}, \r\n        {id: 7825, name: \"Edit React Lectures\", completed: false}, \r\n        {id: 8391, name: \"Watch Lectures\", completed: false}\r\n    ]);\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <ul>\r\n            <div className='header'>\r\n                <h1>TaskList</h1>\r\n                <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide Tasks\" : \"Show Tasks\"}</button>\r\n            </div>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "028/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "028/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "029/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "029/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "029/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "029/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "029/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "029/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "029/src/App.css",
    "content": ".App{\n  text-align: center;\n  padding: 0px 10px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "029/src/App.js",
    "content": "import { useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport { AddTask } from \"./components/AddTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasks, setTasks] = useState([]);\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <AddTask tasks={tasks} setTasks={setTasks} />\n        <TaskList tasks={tasks} setTasks={setTasks} />\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "029/src/components/AddTask.css",
    "content": ".addtask{\r\n    max-width: 800px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.addtask form{\r\n    display: flex;\r\n    justify-content: space-around;\r\n    align-items: center;\r\n    flex-wrap: wrap;\r\n}\r\n\r\n.addtask label{\r\n    font-size: 20px;\r\n    margin-right: 5px;\r\n}\r\n\r\n.addtask input{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border: 1px solid #878787;\r\n    border-radius: 5px;\r\n    flex-grow: 1;\r\n    margin: 10px;\r\n}\r\n\r\n.addtask input:focus{\r\n    outline: none;\r\n}\r\n\r\n.addtask select{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    cursor: pointer;\r\n}\r\n\r\n.addtask button{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #129762;\r\n}\r\n\r\n.addtask .reset{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    border-radius: 5px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "029/src/components/AddTask.js",
    "content": "import { useState } from \"react\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const AddTask = ({tasks, setTasks}) => {\r\n    const [taskValue, setTaskValue] = useState(\"\");\r\n    const [progress, setProgress] = useState(false);\r\n\r\n    const handleChange = (event) => {\r\n        setTaskValue(event.target.value);\r\n    }\r\n\r\n    const handleReset = () => {\r\n        setTaskValue(\"\");\r\n        setProgress(false);\r\n    }\r\n\r\n    const handleSubmit = (event) => {\r\n        event.preventDefault();\r\n        const task = {\r\n            id: Math.floor(Math.random() * 10000),\r\n            name: taskValue,\r\n            completed: Boolean(progress)\r\n        }\r\n        setTasks([...tasks, task]);\r\n        handleReset();\r\n    }\r\n\r\n  return (\r\n    <section className=\"addtask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input onChange={handleChange} type=\"text\" name=\"task\" id=\"task\" placeholder=\"Task Name\" autoComplete=\"off\" value={taskValue} />\r\n            <select onChange={(event) => setProgress(event.target.value)} value={progress}>\r\n                <option value=\"false\">Pending</option>\r\n                <option value=\"true\">Completed</option>\r\n            </select>\r\n            <span onClick={handleReset} className=\"reset\">Reset</span>\r\n            <button type=\"submit\">Add Task</button>\r\n        </form>\r\n        <p>{taskValue}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "029/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    height: 70px;\r\n    font-size: 18px;\r\n    border-top: 1px solid var(--theme-border);\r\n}"
  },
  {
    "path": "029/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "029/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 20px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 45px;\r\n}"
  },
  {
    "path": "029/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "029/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font-size: 20px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "029/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "029/src/components/TaskList.css",
    "content": ".tasklist ul{\r\n    max-width: 800px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.tasklist .header{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 20px 10px;\r\n    margin-bottom: 30px;\r\n}\r\n\r\n.tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n    font-size: 16px;\r\n}"
  },
  {
    "path": "029/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport \"./TaskList.css\";\r\n\r\nexport const TaskList = ({tasks, setTasks}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <ul>\r\n            <div className='header'>\r\n                <h1>TaskList</h1>\r\n                <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide Tasks\" : \"Show Tasks\"}</button>\r\n            </div>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "029/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "029/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "030/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "030/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "030/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "030/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "030/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "030/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "030/src/App.css",
    "content": ".App{\n  text-align: center;\n  padding: 0px 10px;\n}\n\n.hidden{\n  display: none;\n}"
  },
  {
    "path": "030/src/App.js",
    "content": "import { useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { TaskList } from \"./components/TaskList\";\nimport { AddTask } from \"./components/AddTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasks, setTasks] = useState([]);\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <AddTask tasks={tasks} setTasks={setTasks} />\n        <TaskList tasks={tasks} setTasks={setTasks} />\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "030/src/components/AddTask.css",
    "content": ".addtask{\r\n    max-width: 800px;\r\n    margin: 50px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.addtask form{\r\n    display: flex;\r\n    justify-content: space-around;\r\n    align-items: center;\r\n    flex-wrap: wrap;\r\n}\r\n\r\n.addtask label{\r\n    font-size: 20px;\r\n    margin-right: 5px;\r\n}\r\n\r\n.addtask input{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border: 1px solid #878787;\r\n    border-radius: 5px;\r\n    flex-grow: 1;\r\n    margin: 10px;\r\n}\r\n\r\n.addtask input:focus{\r\n    outline: none;\r\n}\r\n\r\n.addtask select{\r\n    font-size: 18px;\r\n    padding: 7px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    cursor: pointer;\r\n}\r\n\r\n.addtask button{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #129762;\r\n}\r\n\r\n.addtask .reset{\r\n    font-size: 18px;\r\n    padding: 7px 10px;\r\n    margin: 10px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    border-radius: 5px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "030/src/components/AddTask.js",
    "content": "import { useState, useRef } from \"react\";\r\nimport \"./AddTask.css\";\r\n\r\nexport const AddTask = ({tasks, setTasks}) => {\r\n    // const [taskValue, setTaskValue] = useState(\"\");\r\n    const [progress, setProgress] = useState(false);\r\n    const taskRef = useRef(\"\");\r\n\r\n    // const handleChange = (event) => {\r\n    //     console.log(taskRef.current.value)\r\n    // }\r\n\r\n    const handleReset = () => {\r\n        // setTaskValue(\"\");\r\n        taskRef.current.value = \"\";\r\n        setProgress(false);\r\n    }\r\n\r\n    const handleSubmit = (event) => {\r\n        event.preventDefault();\r\n        const task = {\r\n            id: Math.floor(Math.random() * 10000),\r\n            name: taskRef.current.value,\r\n            completed: Boolean(progress)\r\n        }\r\n        setTasks([...tasks, task]);\r\n        handleReset();\r\n    }\r\n\r\n  return (\r\n    <section className=\"addtask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" id=\"task\" placeholder=\"Task Name\" autoComplete=\"off\" ref={taskRef} />\r\n            <select onChange={(event) => setProgress(event.target.value)} value={progress}>\r\n                <option value=\"false\">Pending</option>\r\n                <option value=\"true\">Completed</option>\r\n            </select>\r\n            <span onClick={handleReset} className=\"reset\">Reset</span>\r\n            <button type=\"submit\">Add Task</button>\r\n        </form>\r\n        <p>{taskRef.current.value}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "030/src/components/Footer.css",
    "content": "footer{\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px;\r\n    height: 70px;\r\n    font-size: 18px;\r\n    border-top: 1px solid var(--theme-border);\r\n}"
  },
  {
    "path": "030/src/components/Footer.js",
    "content": "import \"./Footer.css\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n        <p>2030 - TaskMate</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "030/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid var(--theme-border);\r\n    font-size: 20px;\r\n    padding: 0px 10px;\r\n}\r\n\r\nheader img{\r\n    max-width: 45px;\r\n}"
  },
  {
    "path": "030/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <img src={Logo} alt=\"\" />\r\n        <a href=\"/\">Home</a>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "030/src/components/TaskCard.css",
    "content": ".taskcard li{\r\n    font-size: 20px;\r\n    list-style: none;\r\n    margin: 20px 5px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    padding: 10px;\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.taskcard li.completed{\r\n    box-shadow: rgb(48, 114, 0) 0px 1px 4px;\r\n}\r\n  \r\n.taskcard li.incomplete{\r\n    box-shadow: rgba(135, 20, 0, 0.689) 0px 1px 4px;\r\n}\r\n\r\n.taskcard button.delete{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: #be3434;\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n}"
  },
  {
    "path": "030/src/components/TaskCard.js",
    "content": "import \"./TaskCard.css\";\r\n\r\nexport const TaskCard = ({ task, handleDelete }) => {\r\n  return (\r\n    <div className=\"taskcard\">\r\n      <li className={ task.completed ? \"completed\" : \"incomplete\" }>\r\n          <span>{task.id} - {task.name}</span>\r\n          <button onClick={() => handleDelete(task.id)} className='delete'>Delete</button>\r\n      </li>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "030/src/components/TaskList.css",
    "content": ".tasklist ul{\r\n    max-width: 800px;\r\n    margin: 20px auto;\r\n    padding: 20px;\r\n    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;\r\n    border-radius: 5px;\r\n}\r\n\r\n.tasklist .header{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 20px 10px;\r\n    margin-bottom: 30px;\r\n}\r\n\r\n.tasklist h1{\r\n    font-size: 28px;\r\n    text-align: center;\r\n}\r\n\r\n.tasklist button.trigger{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    background-color: var(--theme-button);\r\n    color: #FFFFFF;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n    font-size: 16px;\r\n}"
  },
  {
    "path": "030/src/components/TaskList.js",
    "content": "import { useState } from 'react';\r\nimport { TaskCard } from './TaskCard';\r\nimport \"./TaskList.css\";\r\n\r\nexport const TaskList = ({tasks, setTasks}) => {\r\n    const [show, setShow] = useState(true);\r\n\r\n    function handleDelete(id){\r\n        setTasks(tasks.filter(task => task.id !== id));\r\n    }\r\n\r\n  return (\r\n    <section className='tasklist'>\r\n        <ul>\r\n            <div className='header'>\r\n                <h1>TaskList</h1>\r\n                <button className='trigger' onClick={() => setShow(!show)}>{ show ? \"Hide Tasks\" : \"Show Tasks\"}</button>\r\n            </div>\r\n            { show && tasks.map((task) => (\r\n                <TaskCard key={task.id} task={task} handleDelete={handleDelete} />\r\n            )) }\r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "030/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n:root{\n  --theme-border: #d7d7d7;\n  --theme-button: #0F3460;\n}\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nli{\n  list-style: none;\n}\n\nbutton{\n  padding: 5px 10px;\n  border: 0px;\n  border-radius: 5px;\n  cursor: pointer;\n  background-color: darkslateblue;\n  color: #FFFFFF;\n}\n"
  },
  {
    "path": "030/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "031/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "031/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "031/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "031/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "031/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "031/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "031/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "031/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n"
  },
  {
    "path": "031/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Hello World!</h1>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "031/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "031/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "032/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "032/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "032/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "032/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "032/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "032/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "032/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "032/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 0px 15px;\n}\n\n.heading {\n  font-size: 22px;\n}\n\n.card {\n  margin: 10px;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n}\n\n.card.unavailable {\n  background-color: #ffbebe;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 14px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px;\n}\n\n.card .name {\n  font-size: 20px;\n}\n\n.card .info {\n  font-size: 18px;\n  display: flex;\n  justify-content: space-between;\n}\n\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 10px;\n  font-size: 20px;\n}\n\nbutton.onlyStock {\n  background-color: #0ca14f;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "032/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "032/src/components/ProductList.js",
    "content": "import { useEffect, useState } from \"react\"\r\n\r\nexport const ProductList = () => {\r\n    const [products, setProducts] = useState([]);\r\n    console.log(products);\r\n    \r\n    useEffect(() => {\r\n        fetch(\"http://localhost:8000/products\")\r\n        .then(response => response.json())\r\n        .then(data => setProducts(data));\r\n    }, []);\r\n\r\n  return (\r\n    <div>ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "032/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "032/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "035/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "035/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "035/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "035/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "035/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "035/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "035/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "035/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 10px;\n  font-size: 20px;\n}\n\nbutton.onlyStock {\n  background-color: #0ca14f;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "035/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "035/src/components/ProductList.js",
    "content": "import { useEffect, useState } from \"react\"\r\n\r\nexport const ProductList = () => {\r\n    const [products, setProducts] = useState([]);\r\n    \r\n    useEffect(() => {\r\n        fetch(\"http://localhost:8000/products\")\r\n        .then(response => response.json())\r\n        .then(data => setProducts(data));\r\n    }, []);\r\n\r\n  return (\r\n    <section>\r\n        { products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "035/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "035/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "036/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "036/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "036/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "036/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "036/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "036/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "036/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "036/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "036/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "036/src/components/ProductList.js",
    "content": "import { useEffect, useState } from \"react\"\r\n\r\nexport const ProductList = () => {\r\n    const [products, setProducts] = useState([]);\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products\");\r\n    const [counter, setCounter] = useState(0);\r\n    \r\n    useEffect(() => {\r\n        fetch(url)\r\n        .then(response => response.json())\r\n        .then(data => setProducts(data));\r\n    }, [url]);\r\n\r\n    useEffect(() => {\r\n        console.log(counter);\r\n    }, [counter]);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setCounter(counter + 1)}>{counter}</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        \r\n        { products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "036/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "036/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "037/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "037/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "037/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "037/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "037/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "037/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "037/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "037/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "037/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "037/src/components/ProductList.js",
    "content": "import { useCallback, useEffect, useState } from \"react\"\r\n\r\nexport const ProductList = () => {\r\n    const [products, setProducts] = useState([]);\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products\");\r\n\r\n    const fetchProducts = useCallback(async () => {\r\n        const response = await fetch(url);\r\n        const data = await response.json();\r\n        setProducts(data);\r\n    }, [url]);   \r\n    \r\n    useEffect(() => {\r\n        fetchProducts();\r\n        console.log(\"-\");\r\n    }, [fetchProducts]);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        \r\n        { products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "037/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "037/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "038/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "038/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "038/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "038/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "038/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "038/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "038/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "038/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "038/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "038/src/components/ProductList.js",
    "content": "import { useState } from \"react\"\r\nimport { useFetch } from \"../hooks/useFetch\";\r\n\r\nexport const ProductList = () => {\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products/\");\r\n    const { data: products } = useFetch(url);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        \r\n        { products && products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "038/src/hooks/useFetch.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const useFetch = (url) => {\r\n    const [data, setData] = useState(null);\r\n\r\n    useEffect(() => {\r\n        const fetchData = async () => {\r\n            const response = await fetch(url);\r\n            const result = await response.json();\r\n            setData(result);\r\n        }\r\n        fetchData();\r\n    }, [url]);\r\n\r\n  return { data }\r\n}\r\n"
  },
  {
    "path": "038/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "038/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "039/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "039/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "039/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "039/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "039/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "039/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "039/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "039/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.loading{\n  margin: auto;\n  width: 200px;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "039/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "039/src/components/ProductList.js",
    "content": "import { useState } from \"react\"\r\nimport { useFetch } from \"../hooks/useFetch\";\r\n\r\nexport const ProductList = () => {\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products/\");\r\n    const { data: products, loading } = useFetch(url);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        { loading && <p>Loading products...</p>}\r\n        \r\n        { products && products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "039/src/hooks/useFetch.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const useFetch = (url) => {\r\n    const [data, setData] = useState(null);\r\n    const [loading, setLoading] = useState(false);\r\n\r\n    useEffect(() => {\r\n        const fetchData = async () => {\r\n            setLoading(true);\r\n            const response = await fetch(url);\r\n            const result = await response.json();\r\n            setLoading(false);\r\n            setData(result);\r\n        }\r\n        fetchData();\r\n    }, [url]);\r\n\r\n  return { data, loading }\r\n}\r\n"
  },
  {
    "path": "039/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "039/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "040/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "040/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "040/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "040/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "040/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "040/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "040/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "040/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.loading{\n  margin: auto;\n  width: 200px;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "040/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "040/src/components/ProductList.js",
    "content": "import { useState } from \"react\"\r\nimport { useFetch } from \"../hooks/useFetch\";\r\n\r\nexport const ProductList = () => {\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products/\");\r\n    const { data: products, loading, error } = useFetch(url);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        { loading && <p>Loading products...</p>}\r\n\r\n        { error && <p>{error}</p>}\r\n        \r\n        { products && products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "040/src/hooks/useFetch.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const useFetch = (url) => {\r\n    const [data, setData] = useState(null);\r\n    const [loading, setLoading] = useState(false);\r\n    const [error, setError] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchData = async () => {\r\n            setLoading(true);\r\n            try{\r\n                const response = await fetch(url);\r\n                if(!response.ok){\r\n                    throw new Error(response.statusText);\r\n                }\r\n                const result = await response.json();\r\n                setLoading(false);\r\n                setData(result);\r\n                setError(\"\");\r\n            } catch(error){\r\n                setLoading(false);\r\n                setError(error.message);\r\n            }\r\n        }\r\n        fetchData();\r\n    }, [url]);\r\n\r\n  return { data, loading, error }\r\n}\r\n"
  },
  {
    "path": "040/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "040/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "041/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "041/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "041/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "041/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "041/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "041/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "041/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "041/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.loading{\n  margin: auto;\n  width: 200px;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "041/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "041/src/components/ProductList.js",
    "content": "import { useState } from \"react\"\r\nimport { useFetch } from \"../hooks/useFetch\";\r\n\r\nexport const ProductList = () => {\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products/\");\r\n    const { data: products, loading, error } = useFetch(url);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        { loading && <p>Loading products...</p>}\r\n\r\n        { error && <p>{error}</p>}\r\n        \r\n        { products && products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "041/src/hooks/useFetch.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const useFetch = (url) => {\r\n    const [data, setData] = useState(null);\r\n    const [loading, setLoading] = useState(false);\r\n    const [error, setError] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const controller = new AbortController()\r\n\r\n        const fetchData = async () => {\r\n            setLoading(true);\r\n            try{\r\n                const response = await fetch(url, { signal: controller.signal });\r\n                if(!response.ok){\r\n                    throw new Error(response.statusText);\r\n                }\r\n                const result = await response.json();\r\n                setLoading(false);\r\n                setData(result);\r\n                setError(\"\");\r\n            } catch(error){\r\n                setLoading(false);\r\n                setError(error.message);\r\n            }\r\n        }\r\n        fetchData();\r\n\r\n        return () => controller.abort();\r\n    }, [url]);\r\n\r\n  return { data, loading, error }\r\n}\r\n"
  },
  {
    "path": "041/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "041/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "042/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "042/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "042/data/db.json",
    "content": "{\r\n    \"products\": [\r\n        {\r\n            \"id\": 10001,\r\n            \"name\": \"Basics To Advanced In React\",\r\n            \"price\": 99,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10002,\r\n            \"name\": \"Django Framework for Beginners\",\r\n            \"price\": 49,\r\n            \"in_stock\": true\r\n        },\r\n        {\r\n            \"id\": 10003,\r\n            \"name\": \"The Complete Guide to Backend Development\",\r\n            \"price\": 49,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10004,\r\n            \"name\": \"Build a Blockchain from Scratch in Go\",\r\n            \"price\": 19,\r\n            \"in_stock\": false\r\n        },\r\n        {\r\n            \"id\": 10005,\r\n            \"name\": \"Build a Blockchain from Scratch in React\",\r\n            \"price\": 199,\r\n            \"in_stock\": false\r\n        }\r\n    ]\r\n}"
  },
  {
    "path": "042/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "042/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "042/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "042/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "042/src/App.css",
    "content": ".App {\n  max-width: 1200px;\n  margin: auto;\n  padding: 0px 15px;\n}\n\nh1{\n  text-align: center;\n  margin: 30px auto;\n}\n\n.heading {\n  font-size: 22px;\n  align-items: center;\n}\n\n.loading{\n  margin: auto;\n  width: 200px;\n}\n\n.filter{\n  display: flex;\n  justify-content: center;\n}\n\n.card {\n  margin: 15px auto;\n  padding: 10px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  max-width: 600px;\n  border-radius: 5px;\n}\n\n.card .id {\n  background-color: #4e06a0;\n  font-size: 12px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  margin: 10px 0px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .name {\n  font-size: 22px;\n  font-weight: 400;\n  margin: 20px 0px;\n}\n\n.card .info {\n  font-size: 20px;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.card .instock {\n  background-color: #06a02d;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\n.card .unavailable {\n  background-color: #a00620;\n  font-size: 16px;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px;\n  display: inline;\n}\n\nbutton {\n  border: 0px;\n  border-radius: 5px;\n  background-color: #0c68a1;\n  color: #FFFFFF;\n  cursor: pointer;\n  padding: 7px 10px;\n  font-size: 20px;\n  display: inline-block;\n  margin: 20px 10px;\n}\n\nbutton.onlyStock {\n  background-color: #037c3a;\n}\n\nbutton.all {\n  background-color: #065ba0;\n}"
  },
  {
    "path": "042/src/App.js",
    "content": "import { ProductList } from './components/ProductList';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Product List</h1>\n      <ProductList />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "042/src/components/ProductList.js",
    "content": "import { useState } from \"react\"\r\nimport { useFetch } from \"../hooks/useFetch\";\r\n\r\nexport const ProductList = () => {\r\n    const [url, setUrl] = useState(\"http://localhost:8000/products/\");\r\n    const { data: products, loading, error } = useFetch(url, { content: \"ABC\"});\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"filter\">\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products\")}>All</button>\r\n            <button onClick={() => setUrl(\"http://localhost:8000/products?in_stock=true\")}>In Stock Only</button>\r\n        </div>\r\n        { loading && <p>Loading products...</p>}\r\n\r\n        { error && <p>{error}</p>}\r\n        \r\n        { products && products.map((product) => (\r\n            <div className=\"card\" key={product.id}>\r\n                <p className=\"id\">{product.id}</p>\r\n                <p className=\"name\">{product.name}</p>\r\n                <p className=\"info\">\r\n                    <span>${product.price}</span>\r\n                    <span className={product.in_stock ? \"instock\" : \"unavailable\"}>{product.in_stock ? \"In Stock\" : \"Unavailable\"}</span>\r\n                </p>\r\n            </div>            \r\n        )) }\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "042/src/hooks/useFetch.js",
    "content": "import { useEffect, useRef, useState } from \"react\";\r\n\r\nexport const useFetch = (url, _body) => {\r\n    const [data, setData] = useState(null);\r\n    const [loading, setLoading] = useState(false);\r\n    const [error, setError] = useState(\"\");\r\n    const body = useRef(_body);\r\n\r\n    useEffect(() => {\r\n        const controller = new AbortController()\r\n\r\n        const fetchData = async () => {\r\n            setLoading(true);\r\n            try{\r\n                const response = await fetch(url, { signal: controller.signal });\r\n                if(!response.ok){\r\n                    throw new Error(response.statusText);\r\n                }\r\n                const result = await response.json();\r\n                setLoading(false);\r\n                setData(result);\r\n                setError(\"\");\r\n                console.log(\"-----\")\r\n            } catch(error){\r\n                setLoading(false);\r\n                setError(error.message);\r\n            }\r\n        }\r\n        fetchData();\r\n\r\n        return () => controller.abort();\r\n    }, [url, body]);\r\n\r\n  return { data, loading, error }\r\n}\r\n"
  },
  {
    "path": "042/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0px;\n  padding: 0px;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}"
  },
  {
    "path": "042/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "045/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "045/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "045/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "045/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "045/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "045/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "045/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "045/src/App.js",
    "content": "import { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\n\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask />\n      <ShowTask />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "045/src/components/AddTask.js",
    "content": "export const AddTask = () => {\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form>\r\n            <input type=\"text\" name=\"task\" autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" />\r\n            <button type=\"submit\">Add</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "045/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span className=\"light\"></span>\r\n            <span className=\"medium\"></span>\r\n            <span className=\"dark activeTheme\"></span>\r\n            <span className=\"gOne\"></span>\r\n            <span className=\"gTwo\"></span>\r\n            <span className=\"gThree\"></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "045/src/components/ShowTask.js",
    "content": "export const ShowTask = () => {\r\n    const tasks = [\r\n        {id: 10001, name: \"TASK A\", time: \"2:09:01 AM 9/14/2030\"},\r\n        {id: 10002, name: \"TASK B\", time: \"2:09:01 AM 9/14/2030\"},\r\n        {id: 10003, name: \"TASK C\", time: \"2:09:01 AM 9/14/2030\"},\r\n    ]\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">0</span>\r\n            </div>\r\n            <button className=\"clearAll\">Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasks.map((task) => (\r\n                <li>\r\n                    <p>\r\n                        <span className=\"name\">{task.name}</span>\r\n                        <span className=\"time\">{task.time}</span>\r\n                    </p>\r\n                    <i className=\"bi bi-pencil-square\"></i>\r\n                    <i className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "045/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "045/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "046/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "046/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "046/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "046/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "046/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "046/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "046/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "046/src/App.js",
    "content": "import { useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasklist, setTasklist] = useState([]);\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask tasklist={tasklist} setTasklist={setTasklist} />\n      <ShowTask tasklist={tasklist} setTasklist={setTasklist} />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "046/src/components/AddTask.js",
    "content": "export const AddTask = ({tasklist, setTasklist}) => {\r\n\r\n  const handleSubmit = (e) => {\r\n    e.preventDefault();\r\n\r\n    const date = new Date();\r\n    const newTask = {\r\n      id: date.getTime(), \r\n      name: e.target.task.value, \r\n      time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`\r\n    }\r\n    setTasklist([...tasklist, newTask]);\r\n    e.target.task.value = \"\";\r\n  }\r\n\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" />\r\n            <button type=\"submit\">Add</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "046/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span className=\"light\"></span>\r\n            <span className=\"medium\"></span>\r\n            <span className=\"dark activeTheme\"></span>\r\n            <span className=\"gOne\"></span>\r\n            <span className=\"gTwo\"></span>\r\n            <span className=\"gThree\"></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "046/src/components/ShowTask.js",
    "content": "export const ShowTask = ({tasklist, setTasklist}) => {\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">{tasklist.length}</span>\r\n            </div>\r\n            <button className=\"clearAll\" onClick={() => setTasklist([])}>Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasklist.map((task) => (\r\n                <li key={task.id}>\r\n                    <p>\r\n                        <span className=\"name\">{task.name}</span>\r\n                        <span className=\"time\">{task.time}</span>\r\n                    </p>\r\n                    <i className=\"bi bi-pencil-square\"></i>\r\n                    <i className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "046/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "046/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "047/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "047/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "047/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "047/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "047/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "047/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "047/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "047/src/App.js",
    "content": "import { useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasklist, setTasklist] = useState([]);\n  const [task, setTask] = useState({});\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask \n        tasklist={tasklist} \n        setTasklist={setTasklist} \n        task={task}\n        setTask={setTask}\n      />\n      <ShowTask \n        tasklist={tasklist} \n        setTasklist={setTasklist}\n        task={task}\n        setTask={setTask}  \n      />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "047/src/components/AddTask.js",
    "content": "export const AddTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n  const handleSubmit = (e) => {\r\n    e.preventDefault();\r\n\r\n    if(task.id){\r\n      const date = new Date();\r\n      const updatedTasklist = tasklist.map((todo) => (\r\n        todo.id === task.id ? {id: task.id, name: task.name, time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`} : todo\r\n      ));\r\n      setTasklist(updatedTasklist);\r\n    } else {\r\n      const date = new Date();\r\n      const newTask = {\r\n        id: date.getTime(), \r\n        name: e.target.task.value, \r\n        time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`\r\n      }\r\n      setTasklist([...tasklist, newTask]);\r\n      e.target.task.value = \"\";\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" value={task.name} autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" onChange={e => setTask({...task, name: e.target.value})} />\r\n            <button type=\"submit\">Add</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "047/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span className=\"light\"></span>\r\n            <span className=\"medium\"></span>\r\n            <span className=\"dark activeTheme\"></span>\r\n            <span className=\"gOne\"></span>\r\n            <span className=\"gTwo\"></span>\r\n            <span className=\"gThree\"></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "047/src/components/ShowTask.js",
    "content": "export const ShowTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n    const handleEdit = (id) => {\r\n        const seletedTask = tasklist.find(todo => todo.id === id);\r\n        setTask(seletedTask);\r\n    }\r\n\r\n    const handleDelete = (id) => {\r\n        const updatedTasklist = tasklist.filter(todo => todo.id !== id);\r\n        setTasklist(updatedTasklist);\r\n    }\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">{tasklist.length}</span>\r\n            </div>\r\n            <button onClick={() => setTasklist([])} className=\"clearAll\">Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasklist.map((todo) => (\r\n                <li key={todo.id}>\r\n                    <p>\r\n                        <span className=\"name\">{todo.name}</span>\r\n                        <span className=\"time\">{todo.time}</span>\r\n                    </p>\r\n                    <i onClick={() => handleEdit(todo.id)} className=\"bi bi-pencil-square\"></i>\r\n                    <i onClick={() => handleDelete(todo.id)} className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "047/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "047/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "048/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "048/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "048/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "048/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "048/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "048/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "048/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "048/src/App.js",
    "content": "import { useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasklist, setTasklist] = useState([]);\n  const [task, setTask] = useState({});\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask \n        tasklist={tasklist} \n        setTasklist={setTasklist} \n        task={task}\n        setTask={setTask}\n      />\n      <ShowTask \n        tasklist={tasklist} \n        setTasklist={setTasklist}\n        task={task}\n        setTask={setTask}  \n      />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "048/src/components/AddTask.js",
    "content": "export const AddTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n  const handleSubmit = (e) => {\r\n    e.preventDefault();\r\n\r\n    if(task.id){\r\n      const date = new Date();\r\n      const updatedTasklist = tasklist.map((todo) => (\r\n        todo.id === task.id ? {id: task.id, name: task.name, time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`} : todo\r\n      ));\r\n      setTasklist(updatedTasklist);\r\n      setTask({});\r\n    } else {\r\n      const date = new Date();\r\n      const newTask = {\r\n        id: date.getTime(), \r\n        name: e.target.task.value, \r\n        time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`\r\n      }\r\n      setTasklist([...tasklist, newTask]);\r\n      setTask({});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" value={task.name || \"\"} autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" onChange={e => setTask({...task, name: e.target.value})} />\r\n            <button type=\"submit\">Add</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "048/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span className=\"light\"></span>\r\n            <span className=\"medium\"></span>\r\n            <span className=\"dark activeTheme\"></span>\r\n            <span className=\"gOne\"></span>\r\n            <span className=\"gTwo\"></span>\r\n            <span className=\"gThree\"></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "048/src/components/ShowTask.js",
    "content": "export const ShowTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n    const handleEdit = (id) => {\r\n        const seletedTask = tasklist.find(todo => todo.id === id);\r\n        setTask(seletedTask);\r\n    }\r\n\r\n    const handleDelete = (id) => {\r\n        const updatedTasklist = tasklist.filter(todo => todo.id !== id);\r\n        setTasklist(updatedTasklist);\r\n    }\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">{tasklist.length}</span>\r\n            </div>\r\n            <button onClick={() => setTasklist([])} className=\"clearAll\">Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasklist.map((todo) => (\r\n                <li key={todo.id}>\r\n                    <p>\r\n                        <span className=\"name\">{todo.name}</span>\r\n                        <span className=\"time\">{todo.time}</span>\r\n                    </p>\r\n                    <i onClick={() => handleEdit(todo.id)} className=\"bi bi-pencil-square\"></i>\r\n                    <i onClick={() => handleDelete(todo.id)} className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "048/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "048/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "049/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "049/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "049/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "049/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "049/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "049/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "049/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "049/src/App.js",
    "content": "import { useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasklist, setTasklist] = useState([]);\n  const [task, setTask] = useState({});\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask \n        tasklist={tasklist} \n        setTasklist={setTasklist} \n        task={task}\n        setTask={setTask}\n      />\n      <ShowTask \n        tasklist={tasklist} \n        setTasklist={setTasklist}\n        task={task}\n        setTask={setTask}  \n      />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "049/src/components/AddTask.js",
    "content": "export const AddTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n  const handleSubmit = (e) => {\r\n    e.preventDefault();\r\n\r\n    if(task.id){\r\n      const date = new Date();\r\n      const updatedTasklist = tasklist.map((todo) => (\r\n        todo.id === task.id ? {id: task.id, name: task.name, time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`} : todo\r\n      ));\r\n      setTasklist(updatedTasklist);\r\n      setTask({});\r\n    } else {\r\n      const date = new Date();\r\n      const newTask = {\r\n        id: date.getTime(), \r\n        name: e.target.task.value, \r\n        time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`\r\n      }\r\n      setTasklist([...tasklist, newTask]);\r\n      setTask({});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" value={task.name || \"\"} autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" onChange={e => setTask({...task, name: e.target.value})} />\r\n            <button type=\"submit\">{ task.id ? \"Update\" : \"Add\" }</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "049/src/components/Header.js",
    "content": "import Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span className=\"light\"></span>\r\n            <span className=\"medium\"></span>\r\n            <span className=\"dark activeTheme\"></span>\r\n            <span className=\"gOne\"></span>\r\n            <span className=\"gTwo\"></span>\r\n            <span className=\"gThree\"></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "049/src/components/ShowTask.js",
    "content": "export const ShowTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n    const handleEdit = (id) => {\r\n        const seletedTask = tasklist.find(todo => todo.id === id);\r\n        setTask(seletedTask);\r\n    }\r\n\r\n    const handleDelete = (id) => {\r\n        const updatedTasklist = tasklist.filter(todo => todo.id !== id);\r\n        setTasklist(updatedTasklist);\r\n    }\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">{tasklist.length}</span>\r\n            </div>\r\n            <button onClick={() => setTasklist([])} className=\"clearAll\">Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasklist.map((todo) => (\r\n                <li key={todo.id}>\r\n                    <p>\r\n                        <span className=\"name\">{todo.name}</span>\r\n                        <span className=\"time\">{todo.time}</span>\r\n                    </p>\r\n                    <i onClick={() => handleEdit(todo.id)} className=\"bi bi-pencil-square\"></i>\r\n                    <i onClick={() => handleDelete(todo.id)} className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "049/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "049/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "050/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "050/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "050/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "050/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "050/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "050/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "050/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "050/src/App.js",
    "content": "import { useEffect, useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasklist, setTasklist] = useState(JSON.parse(localStorage.getItem(\"tasklist\")) || []);\n  const [task, setTask] = useState({});\n\n  useEffect(() => {\n    localStorage.setItem(\"tasklist\", JSON.stringify(tasklist))\n  }, [tasklist]);\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask \n        tasklist={tasklist} \n        setTasklist={setTasklist} \n        task={task}\n        setTask={setTask}\n      />\n      <ShowTask \n        tasklist={tasklist} \n        setTasklist={setTasklist}\n        task={task}\n        setTask={setTask}  \n      />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "050/src/components/AddTask.js",
    "content": "export const AddTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n  const handleSubmit = (e) => {\r\n    e.preventDefault();\r\n\r\n    if(task.id){\r\n      const date = new Date();\r\n      const updatedTasklist = tasklist.map((todo) => (\r\n        todo.id === task.id ? {id: task.id, name: task.name, time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`} : todo\r\n      ));\r\n      setTasklist(updatedTasklist);\r\n      setTask({});\r\n    } else {\r\n      const date = new Date();\r\n      const newTask = {\r\n        id: date.getTime(), \r\n        name: e.target.task.value, \r\n        time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`\r\n      }\r\n      setTasklist([...tasklist, newTask]);\r\n      setTask({});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" value={task.name || \"\"} autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" onChange={e => setTask({...task, name: e.target.value})} />\r\n            <button type=\"submit\">{ task.id ? \"Update\" : \"Add\" }</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "050/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  const [theme, setTheme] = useState(JSON.parse(localStorage.getItem(\"theme\")) || \"medium\");\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"theme\", JSON.stringify(theme));\r\n    document.documentElement.removeAttribute(\"class\");\r\n    document.documentElement.classList.add(theme);\r\n  }, [theme]);\r\n\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span onClick={() => setTheme(\"light\")} className={ theme === \"light\" ? \"light activeTheme\" : \"light\"}></span>\r\n            <span onClick={() => setTheme(\"medium\")} className={ theme === \"medium\" ? \"medium activeTheme\" : \"medium\"}></span>\r\n            <span onClick={() => setTheme(\"dark\")} className={ theme === \"dark\" ? \"dark activeTheme\" : \"dark\"}></span>\r\n            <span onClick={() => setTheme(\"gOne\")} className={ theme === \"gOne\" ? \"gOne activeTheme\" : \"gOne\"}></span>\r\n            <span onClick={() => setTheme(\"gTwo\")} className={ theme === \"gTwo\" ? \"gTwo activeTheme\" : \"gTwo\"}></span>\r\n            <span onClick={() => setTheme(\"gThree\")} className={ theme === \"gThree\" ? \"gThree activeTheme\" : \"gThree\"}></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "050/src/components/ShowTask.js",
    "content": "export const ShowTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n    const handleEdit = (id) => {\r\n        const seletedTask = tasklist.find(todo => todo.id === id);\r\n        setTask(seletedTask);\r\n    }\r\n\r\n    const handleDelete = (id) => {\r\n        const updatedTasklist = tasklist.filter(todo => todo.id !== id);\r\n        setTasklist(updatedTasklist);\r\n    }\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">{tasklist.length}</span>\r\n            </div>\r\n            <button onClick={() => setTasklist([])} className=\"clearAll\">Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasklist.map((todo) => (\r\n                <li key={todo.id}>\r\n                    <p>\r\n                        <span className=\"name\">{todo.name}</span>\r\n                        <span className=\"time\">{todo.time}</span>\r\n                    </p>\r\n                    <i onClick={() => handleEdit(todo.id)} className=\"bi bi-pencil-square\"></i>\r\n                    <i onClick={() => handleDelete(todo.id)} className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "050/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "050/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "051/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "051/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "051/package.json",
    "content": "{\n  \"name\": \"taskmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "051/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Taskmate - React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "051/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "051/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "051/src/App.css",
    "content": ".App{\n  min-height: 100vh;\n  max-width: 1200px;\n  margin: auto;\n  padding: 10px 10px;\n}\n\nheader{\n  min-height: 70px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 15px;\n  margin-bottom: 70px;\n  background-color: #FFFFFF;\n  border-radius: 5px;\n  box-shadow: var(--box-shadow);\n}\n\nheader .logo{\n  display: flex;\n  align-items: center;\n}\n\nheader .logo img{\n  max-width: 40px;\n  cursor: pointer;\n}\n\nheader .logo span{\n  font-size: 22px;\n  margin-left: 7px;\n  cursor: pointer;\n  color: #525252;\n}\n\nheader .themeSelector span{\n  height: 20px;\n  width: 20px;\n  border-radius: 50%;\n  display: inline-block;\n  margin-left: 5px;\n  cursor: pointer;\n  border: 1px solid #dfdfdf;\n}\n\nheader .themeSelector .activeTheme{\n  height: 30px;\n  width: 30px;\n}\n\n.addTask {\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  max-width: 500px;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.addTask form{\n  display: flex;\n  gap: 7px;\n}\n\n.addTask form input{\n  flex-grow: 1;\n  padding: 5px 5px;\n  border: 1px solid #eaeaea;\n  border-radius: 5px;\n  font-size: 18px;\n}\n\n.addTask form input:focus{\n  outline: 0.5px solid #eaeaea;\n}\n\n.addTask form button{\n  background-color: #03ba5c;\n  color: #FFFFFF;\n  border: none;\n  padding: 5px 20px;\n  border-radius: 5px;\n  cursor: pointer;\n  font-size: 18px;\n}\n\n.addTask form button:hover{\n  background-color: #03b056;\n}\n\n.showTask{\n  padding: 20px 15px;\n  border-radius: 5px;\n  background-color: #FFFFFF;\n  margin: 20px auto;\n  box-shadow: var(--box-shadow);\n}\n\n.showTask div.head{\n  padding: 10px 0px 20px 0px;\n  border-bottom: 1px solid #dfdfdf;\n  display: flex;\n  align-items: center;\n}\n\n.showTask div.head div{\n  flex-grow: 1;\n}\n\n.showTask .title{\n  font-size: 18px;\n  font-weight: 600;\n  user-select: none;\n}\n\n.showTask .count{\n  background-color: #dfdfdf;\n  color: #525252;\n  padding: 5px 10px;\n  border-radius: 50%;\n  margin-left: 10px;\n  user-select: none;\n}\n\n.showTask .clearAll{\n  background-color: #0f6af3;\n  color: #FFFFFF;\n  padding: 5px 10px;\n  border-radius: 5px;\n  cursor: pointer;\n  border: 0px;\n  font-size: 16px;\n}\n\n.showTask .clearAll:hover{\n  background-color: #1061db;\n}\n\n.showTask ul{\n  margin: 30px 5px 20px 5px;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-around;\n  flex-wrap: wrap;\n  gap: 15px;\n}\n\n.showTask li{\n  padding: 15px 10px;\n  border-bottom: 1px solid #e5e5e5;\n  display: flex;\n  gap: 5px;\n  width: 350px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  border-left: 5px solid #1365dfaf;\n}\n\n.showTask li:hover{\n  background-color: #f8f8f8;\n}\n\n.showTask li p{\n  flex-grow: 1;\n  display: flex;\n  flex-direction: column;\n}\n\n.showTask li .name{\n  font-size: 18px;\n  padding-bottom: 5px;\n}\n\n.showTask li .time{\n  font-size: 12px;\n  color: #737373;\n}\n\n.showTask i.bi-pencil-square{\n  font-size: 18px;\n  color: #1363DF;\n  cursor: pointer;\n}\n\n.showTask i.bi-trash{\n  font-size: 18px;\n  color: #D82148;\n  cursor: pointer;\n}\n\n@media only screen and (max-width: 800px) {\n  .showTask li{\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "051/src/App.js",
    "content": "import { useEffect, useState } from \"react\";\nimport { Header } from \"./components/Header\";\nimport { AddTask } from \"./components/AddTask\";\nimport { ShowTask } from \"./components/ShowTask\";\nimport './App.css';\n\n\nfunction App() {\n  const [tasklist, setTasklist] = useState(JSON.parse(localStorage.getItem(\"tasklist\")) || []);\n  const [task, setTask] = useState({});\n\n  useEffect(() => {\n    localStorage.setItem(\"tasklist\", JSON.stringify(tasklist))\n  }, [tasklist]);\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AddTask \n        tasklist={tasklist} \n        setTasklist={setTasklist} \n        task={task}\n        setTask={setTask}\n      />\n      <ShowTask \n        tasklist={tasklist} \n        setTasklist={setTasklist}\n        task={task}\n        setTask={setTask}  \n      />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "051/src/components/AddTask.js",
    "content": "export const AddTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n  const handleSubmit = (e) => {\r\n    e.preventDefault();\r\n\r\n    if(task.id){\r\n      const date = new Date();\r\n      const updatedTasklist = tasklist.map((todo) => (\r\n        todo.id === task.id ? {id: task.id, name: task.name, time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`} : todo\r\n      ));\r\n      setTasklist(updatedTasklist);\r\n      setTask({});\r\n    } else {\r\n      const date = new Date();\r\n      const newTask = {\r\n        id: date.getTime(), \r\n        name: e.target.task.value, \r\n        time: `${date.toLocaleTimeString()} ${date.toLocaleDateString()}`\r\n      }\r\n      setTasklist([...tasklist, newTask]);\r\n      setTask({});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section className=\"addTask\">\r\n        <form onSubmit={handleSubmit}>\r\n            <input type=\"text\" name=\"task\" value={task.name || \"\"} autoComplete=\"off\" placeholder=\"add task\" maxLength=\"25\" onChange={e => setTask({...task, name: e.target.value})} />\r\n            <button type=\"submit\">{ task.id ? \"Update\" : \"Add\" }</button>\r\n        </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "051/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  const [theme, setTheme] = useState(JSON.parse(localStorage.getItem(\"theme\")) || \"medium\");\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"theme\", JSON.stringify(theme));\r\n    document.documentElement.removeAttribute(\"class\");\r\n    document.documentElement.classList.add(theme);\r\n  }, [theme]);\r\n\r\n  return (\r\n    <header>\r\n        <div className=\"logo\">\r\n            <img src={Logo} alt=\"Taskmate Logo\" />\r\n            <span>Taskmate</span>\r\n        </div>\r\n        <div className=\"themeSelector\">\r\n            <span onClick={() => setTheme(\"light\")} className={ theme === \"light\" ? \"light activeTheme\" : \"light\"}></span>\r\n            <span onClick={() => setTheme(\"medium\")} className={ theme === \"medium\" ? \"medium activeTheme\" : \"medium\"}></span>\r\n            <span onClick={() => setTheme(\"dark\")} className={ theme === \"dark\" ? \"dark activeTheme\" : \"dark\"}></span>\r\n            <span onClick={() => setTheme(\"gOne\")} className={ theme === \"gOne\" ? \"gOne activeTheme\" : \"gOne\"}></span>\r\n            <span onClick={() => setTheme(\"gTwo\")} className={ theme === \"gTwo\" ? \"gTwo activeTheme\" : \"gTwo\"}></span>\r\n            <span onClick={() => setTheme(\"gThree\")} className={ theme === \"gThree\" ? \"gThree activeTheme\" : \"gThree\"}></span>\r\n        </div>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "051/src/components/ShowTask.js",
    "content": "export const ShowTask = ({tasklist, setTasklist, task, setTask}) => {\r\n\r\n    const handleEdit = (id) => {\r\n        const seletedTask = tasklist.find(todo => todo.id === id);\r\n        setTask(seletedTask);\r\n    }\r\n\r\n    const handleDelete = (id) => {\r\n        const updatedTasklist = tasklist.filter(todo => todo.id !== id);\r\n        setTasklist(updatedTasklist);\r\n    }\r\n\r\n  return (\r\n    <section className=\"showTask\">\r\n        <div className=\"head\">\r\n            <div>\r\n                <span className=\"title\">Todo</span>\r\n                <span className=\"count\">{tasklist.length}</span>\r\n            </div>\r\n            <button onClick={() => setTasklist([])} className=\"clearAll\">Clear All</button>\r\n        </div>\r\n        <ul>\r\n            { tasklist.map((todo) => (\r\n                <li key={todo.id}>\r\n                    <p>\r\n                        <span className=\"name\">{todo.name}</span>\r\n                        <span className=\"time\">{todo.time}</span>\r\n                    </p>\r\n                    <i onClick={() => handleEdit(todo.id)} className=\"bi bi-pencil-square\"></i>\r\n                    <i onClick={() => handleDelete(todo.id)} className=\"bi bi-trash\"></i>\r\n                </li>\r\n            )) }            \r\n        </ul>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "051/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\n/* themes */\n.light{\n  background-color: #FFFFFF;\n  transition: all 500ms;\n}\n\n.medium{\n  background-color: #EFEFEF;\n  transition: all 500ms;\n}\n\n.dark{\n  background-color: #15202B;\n  transition: all 500ms;\n}\n\n.gOne{\n  background: linear-gradient(90deg, hsla(191, 75%, 60%, 1) 0%, hsla(248, 87%, 36%, 1) 100%);\n  transition: all 500ms;\n}\n.gTwo{\n  background: linear-gradient(235deg, #FFFFFF 0%, #000F25 100%), linear-gradient(180deg, #6100FF 0%, #000000 100%), linear-gradient(235deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%), linear-gradient(125deg, #FFA3AC 0%, #FFA3AC 40%, #00043C calc(40% + 1px), #00043C 60%, #005D6C calc(60% + 1px), #005D6C 70%, #00C9B1 calc(70% + 1px), #00C9B1 100%);\n  background-blend-mode: soft-light, screen, darken, normal;\n}\n\n.gThree{\n  background: linear-gradient(125deg, #FFFFFF 0%, #000000 100%), linear-gradient(200deg, #FFD9E8 0%, #FFD9E8 50%, #DE95BA calc(50% + 1px), #DE95BA 60%, #7F4A88 calc(60% + 1px), #7F4A88 75%, #4A266A calc(75% + 1px), #4A266A 100%), linear-gradient(113deg, #FFD9E8 0%, #FFD9E8 40%, #DE95BA calc(40% + 1px), #DE95BA 50%, #7F4A88 calc(50% + 1px), #7F4A88 70%, #4A266A calc(70% + 1px), #4A266A 100%);\n  background-blend-mode: overlay, overlay, normal;\n}\n/* themes */\n"
  },
  {
    "path": "051/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);\n"
  },
  {
    "path": "053/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "053/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "053/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "053/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "053/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "053/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "053/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 680px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid var(--theme-border);\n}"
  },
  {
    "path": "053/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Hello World</h1>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "053/src/components/Contact.js",
    "content": "export const Contact = () => {\r\n  return (\r\n    <div>Contact</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "053/src/components/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <div>Footer</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "053/src/components/Header.js",
    "content": "export const Header = () => {\r\n  return (\r\n    <div>Header</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "053/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div>Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "053/src/components/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <div>ProductDetail</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "053/src/components/ProductList.js",
    "content": "export const ProductList = () => {\r\n  return (\r\n    <div>ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "053/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "053/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 100vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n"
  },
  {
    "path": "053/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "054/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "054/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "054/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "054/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "054/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "054/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "054/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 680px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid var(--theme-border);\n}"
  },
  {
    "path": "054/src/App.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home } from \"./components/Home\";\nimport { ProductList } from \"./components/ProductList\";\nimport { ProductDetail } from \"./components/ProductDetail\";\nimport { Contact } from \"./components/Contact\";\n\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <header>HEADER</header>\n      <Routes>\n        <Route path=\"/\" element={<Home />}></Route>\n        <Route path=\"products\" element={<ProductList />}></Route>\n        <Route path=\"products/1001\" element={<ProductDetail />}></Route>\n        <Route path=\"contact\" element={<Contact />}></Route>\n      </Routes>\n      <footer>FOOTER</footer>\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "054/src/components/Contact.js",
    "content": "export const Contact = () => {\r\n  return (\r\n    <div>Contact</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "054/src/components/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <div>Footer</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "054/src/components/Header.js",
    "content": "export const Header = () => {\r\n  return (\r\n    <div>Header</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "054/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div>Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "054/src/components/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <div>ProductDetail</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "054/src/components/ProductList.js",
    "content": "export const ProductList = () => {\r\n  return (\r\n    <div>ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "054/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "054/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 100vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n"
  },
  {
    "path": "054/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "055/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "055/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "055/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "055/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "055/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "055/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "055/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 480px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid var(--theme-border);\n}"
  },
  {
    "path": "055/src/App.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { Home } from \"./components/Home\";\nimport { ProductList } from \"./components/ProductList\";\nimport { ProductDetail } from \"./components/ProductDetail\";\nimport { Contact } from \"./components/Contact\";\n\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <Routes>\n          <Route path=\"/\" element={<Home />} />\n          <Route path=\"products\" element={<ProductList />} />\n          <Route path=\"products/1001\" element={<ProductDetail />} />\n          <Route path=\"contact\" element={<Contact />} />\n        </Routes>\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "055/src/components/Contact.js",
    "content": "export const Contact = () => {\r\n  return (\r\n    <div>Contact</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "055/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <Link to=\"/\">2030 Routemate</Link>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "055/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Routemate Logo\" />\r\n        <span>Routemate</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/products\" className=\"link\">Products</NavLink>\r\n        <NavLink to=\"/contact\" className=\"link\">Contact</NavLink>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "055/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div>Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "055/src/components/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <div>ProductDetail</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "055/src/components/ProductList.js",
    "content": "export const ProductList = () => {\r\n  return (\r\n    <div>ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "055/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "055/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n"
  },
  {
    "path": "055/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "056/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "056/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "056/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "056/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "056/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "056/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "056/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\n.component{\n  font-size: 22px;\n  padding: 20px 10px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  text-align: center;\n  margin: 20px 0px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 480px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid #EEEEEE;\n}"
  },
  {
    "path": "056/src/App.js",
    "content": "import { Routes, Route, Navigate } from \"react-router-dom\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { Home } from \"./components/Home\";\nimport { ProductList } from \"./components/ProductList\";\nimport { ProductDetail } from \"./components/ProductDetail\";\nimport { Contact } from \"./components/Contact\";\nimport { Admin } from \"./components/Admin\"\n\nimport './App.css';\n\nfunction App() {\n  const user = true;\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <Routes>\n          <Route path=\"/\" element={<Home />} />\n          <Route path=\"products\" element={<ProductList />} />\n          <Route path=\"products/:id\" element={<ProductDetail />} />\n          <Route path=\"contact\" element={<Contact />} />\n          <Route path=\"/admin\" element={ user ? <Admin /> : <Navigate to=\"/\" />} />\n        </Routes>\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "056/src/components/Admin.js",
    "content": "export const Admin = () => {\r\n  return (\r\n    <div className=\"component\">Welcome To Admin Section</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/components/Contact.js",
    "content": "import { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Contact = () => {\r\n  const navigate = useNavigate();\r\n\r\n  const handleSubmit = () => {\r\n    console.log(\"------\");\r\n    return navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <div className=\"component\">Contact</div>\r\n      <button onClick={handleSubmit}>Submit Form</button>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <Link to=\"/\">2030 Routemate</Link>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Routemate Logo\" />\r\n        <span>Routemate</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/products\" className=\"link\">Products</NavLink>\r\n        <NavLink to=\"/contact\" className=\"link\">Contact</NavLink>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div className=\"component\">Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/components/ProductDetail.js",
    "content": "import { useParams } from \"react-router-dom\";\r\n\r\nexport const ProductDetail = () => {\r\n  const params = useParams();\r\n\r\n  return (\r\n    <div className=\"component\">ProductDetail - {params.id}</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/components/ProductList.js",
    "content": "import { useSearchParams, useLocation } from \"react-router-dom\";\r\n\r\nexport const ProductList = () => {\r\n  const [searchParams] = useSearchParams();\r\n  // console.log(searchParams.get(\"keyword\"));\r\n\r\n  const location = useLocation();\r\n  // console.log(location);\r\n\r\n  return (\r\n    <div className=\"component\">ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "056/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "056/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nbutton{\n  border: 0px;\n  padding: 5px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  cursor: pointer;\n  border-radius: 5px;\n}"
  },
  {
    "path": "056/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "057/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "057/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "057/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "057/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "057/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "057/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "057/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\n.component{\n  font-size: 22px;\n  padding: 20px 10px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  text-align: center;\n  margin: 20px 0px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 480px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid #EEEEEE;\n}"
  },
  {
    "path": "057/src/App.js",
    "content": "import { Routes, Route, Navigate } from \"react-router-dom\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { Home } from \"./components/Home\";\nimport { ProductList } from \"./components/ProductList\";\nimport { ProductDetail } from \"./components/ProductDetail\";\nimport { Contact } from \"./components/Contact\";\nimport { Admin } from \"./components/Admin\";\nimport { PageNotFound } from \"./components/PageNotFound\";\n\nimport './App.css';\n\nfunction App() {\n  const user = true;\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <Routes>\n          <Route path=\"/\" element={<Home />} />\n          <Route path=\"products\" element={<ProductList />} />\n          <Route path=\"products/:id\" element={<ProductDetail />} />\n          <Route path=\"contact\" element={<Contact />} />\n          <Route path=\"admin\" element={ user ? <Admin /> : <Navigate to=\"/\" />} />\n          <Route path=\"*\" element={<PageNotFound />} />\n        </Routes>\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "057/src/components/Admin.js",
    "content": "export const Admin = () => {\r\n  return (\r\n    <div className=\"component\">Welcome To Admin Section</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/Contact.js",
    "content": "import { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Contact = () => {\r\n  const navigate = useNavigate();\r\n\r\n  const handleSubmit = () => {\r\n    console.log(\"------\");\r\n    return navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <div className=\"component\">Contact</div>\r\n      <button onClick={handleSubmit}>Submit Form</button>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <Link to=\"/\">2030 Routemate</Link>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Routemate Logo\" />\r\n        <span>Routemate</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/products\" className=\"link\">Products</NavLink>\r\n        <NavLink to=\"/contact\" className=\"link\">Contact</NavLink>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div className=\"component\">Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <div className=\"component\">404 Opps!</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/ProductDetail.js",
    "content": "import { useParams } from \"react-router-dom\";\r\n\r\nexport const ProductDetail = () => {\r\n  const params = useParams();\r\n\r\n  return (\r\n    <div className=\"component\">ProductDetail - {params.id}</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/components/ProductList.js",
    "content": "import { useSearchParams, useLocation } from \"react-router-dom\";\r\n\r\nexport const ProductList = () => {\r\n  const [searchParams] = useSearchParams();\r\n  // console.log(searchParams.get(\"keyword\"));\r\n\r\n  const location = useLocation();\r\n  // console.log(location);\r\n\r\n  return (\r\n    <div className=\"component\">ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "057/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "057/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nbutton{\n  border: 0px;\n  padding: 5px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  cursor: pointer;\n  border-radius: 5px;\n}"
  },
  {
    "path": "057/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "058/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "058/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "058/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "058/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "058/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "058/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "058/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\n.component{\n  font-size: 22px;\n  padding: 20px 10px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  text-align: center;\n  margin: 20px 0px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 480px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid #EEEEEE;\n}"
  },
  {
    "path": "058/src/App.js",
    "content": "import { Routes, Route, Navigate } from \"react-router-dom\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { Home } from \"./components/Home\";\nimport { ProductList } from \"./components/ProductList\";\nimport { ProductDetail } from \"./components/ProductDetail\";\nimport { Contact } from \"./components/Contact\";\nimport { Admin } from \"./components/Admin\";\nimport { PageNotFound } from \"./components/PageNotFound\";\n\nimport './App.css';\n\nfunction App() {\n  const user = true;\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <Routes>\n          <Route path=\"/\" element={<Home />} />\n          <Route path=\"products\" element={<ProductList />} />\n          <Route path=\"products/:id\" element={<ProductDetail />} />\n          <Route path=\"contact\" element={<Contact />} />\n          <Route path=\"admin\" element={ user ? <Admin /> : <Navigate to=\"/\" />} />\n          <Route path=\"*\" element={<PageNotFound />} />\n        </Routes>\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "058/src/components/Admin.js",
    "content": "export const Admin = () => {\r\n  return (\r\n    <div className=\"component\">Welcome To Admin Section</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/Contact.js",
    "content": "import { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Contact = () => {\r\n  const navigate = useNavigate();\r\n\r\n  const handleSubmit = () => {\r\n    console.log(\"------\");\r\n    return navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <div className=\"component\">Contact</div>\r\n      <button onClick={handleSubmit}>Submit Form</button>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <Link to=\"/\">2030 Routemate</Link>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Routemate Logo\" />\r\n        <span>Routemate</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/products\" className=\"link\">Products</NavLink>\r\n        <NavLink to=\"/contact\" className=\"link\">Contact</NavLink>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div className=\"component\">Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <div className=\"component\">404 Opps!</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/ProductDetail.js",
    "content": "import { useParams } from \"react-router-dom\";\r\n\r\nexport const ProductDetail = () => {\r\n  const params = useParams();\r\n\r\n  return (\r\n    <div className=\"component\">ProductDetail - {params.id}</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/components/ProductList.js",
    "content": "import { useSearchParams, useLocation } from \"react-router-dom\";\r\n\r\nexport const ProductList = () => {\r\n  const [searchParams] = useSearchParams();\r\n  // console.log(searchParams.get(\"keyword\"));\r\n\r\n  const location = useLocation();\r\n  // console.log(location);\r\n\r\n  return (\r\n    <div className=\"component\">ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "058/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "058/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nbutton{\n  border: 0px;\n  padding: 5px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  cursor: pointer;\n  border-radius: 5px;\n}"
  },
  {
    "path": "058/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "059/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "059/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "059/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "059/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "059/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "059/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "059/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\n.component{\n  font-size: 22px;\n  padding: 20px 10px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  text-align: center;\n  margin: 20px 0px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 480px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid #EEEEEE;\n}"
  },
  {
    "path": "059/src/App.js",
    "content": "import { Routes, Route, Navigate } from \"react-router-dom\";\nimport { Header } from \"./components/Header\";\nimport { Footer } from \"./components/Footer\";\nimport { Home } from \"./components/Home\";\nimport { ProductList } from \"./components/ProductList\";\nimport { ProductDetail } from \"./components/ProductDetail\";\nimport { Contact } from \"./components/Contact\";\nimport { Admin } from \"./components/Admin\";\nimport { PageNotFound } from \"./components/PageNotFound\";\nimport { ContactIn } from \"./components/ContactIn\";\nimport { ContactEu } from \"./components/ContactEu\";\nimport { ContactUs } from \"./components/ContactUs\";\n\nimport './App.css';\n\nfunction App() {\n  const user = true;\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <main>\n        <Routes>\n          <Route path=\"/\" element={<Home />} />\n          <Route path=\"products\" element={<ProductList />} />\n          <Route path=\"products/:id\" element={<ProductDetail />} />\n          <Route path=\"contact\" element={<Contact />} >\n            <Route path=\"in\" element={<ContactIn />} />\n            <Route path=\"eu\" element={<ContactEu />} />\n            <Route path=\"us\" element={<ContactUs />} />\n          </Route>\n          <Route path=\"admin\" element={ user ? <Admin /> : <Navigate to=\"/\" />} />\n          <Route path=\"*\" element={<PageNotFound />} />\n        </Routes>\n      </main>\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "059/src/components/Admin.js",
    "content": "export const Admin = () => {\r\n  return (\r\n    <div className=\"component\">Welcome To Admin Section</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/Contact.js",
    "content": "import { useNavigate, Outlet } from \"react-router-dom\";\r\n\r\nexport const Contact = () => {\r\n  const navigate = useNavigate();\r\n\r\n  const handleSubmit = () => {\r\n    console.log(\"------\");\r\n    return navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <div className=\"component\">Contact</div>\r\n      <Outlet />\r\n      <button onClick={handleSubmit}>Submit Form</button>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/ContactEu.js",
    "content": "export const ContactEu = () => {\r\n  return (\r\n    <div className=\"component\">ContactEu</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/ContactIn.js",
    "content": "export const ContactIn = () => {\r\n  return (\r\n    <div className=\"component\">ContactIn</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/ContactUs.js",
    "content": "export const ContactUs = () => {\r\n  return (\r\n    <div className=\"component\">ContactUs</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <Link to=\"/\">2030 Routemate</Link>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Routemate Logo\" />\r\n        <span>Routemate</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/products\" className=\"link\">Products</NavLink>\r\n        <NavLink to=\"/contact\" className=\"link\">Contact</NavLink>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <div className=\"component\">Home</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <div className=\"component\">404 Opps!</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/ProductDetail.js",
    "content": "import { useParams } from \"react-router-dom\";\r\n\r\nexport const ProductDetail = () => {\r\n  const params = useParams();\r\n\r\n  return (\r\n    <div className=\"component\">ProductDetail - {params.id}</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/components/ProductList.js",
    "content": "import { useSearchParams, useLocation } from \"react-router-dom\";\r\n\r\nexport const ProductList = () => {\r\n  const [searchParams] = useSearchParams();\r\n  // console.log(searchParams.get(\"keyword\"));\r\n\r\n  const location = useLocation();\r\n  // console.log(location);\r\n\r\n  return (\r\n    <div className=\"component\">ProductList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "059/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "059/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nbutton{\n  border: 0px;\n  padding: 5px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  cursor: pointer;\n  border-radius: 5px;\n}"
  },
  {
    "path": "059/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "060/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "060/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "060/package.json",
    "content": "{\n  \"name\": \"routemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "060/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React Router - Routemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "060/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "060/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "060/src/App.css",
    "content": ".App {\n  max-width: 1280px;\n  margin: auto;\n  padding: 0px 10px;\n}\n\n.component{\n  font-size: 22px;\n  padding: 20px 10px;\n  box-shadow: var(--box-shadow);\n  border-radius: 5px;\n  text-align: center;\n  margin: 20px 0px;\n}\n\nheader {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n@media screen and (max-width: 480px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.productList{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.productCard{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.productCard img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.productCard .name{\n  margin: 10px 0px;\n}\n\n.productCard p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.productCard .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.productCard button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.productCard button:hover{\n  background-color: #103f80;\n}\n\n.productDetail{\n  display: flex;\n  justify-content: space-between;\n}\n\n.productDetail .visual{\n  width: 50%;\n}\n\n.productDetail .visual img{\n  width: 100%;\n}\n\n.productDetail .info{\n  max-width: 50%;\n}\n\n.productDetail .info .name{\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.productDetail .info .description{\n  font-size: 18px;\n}\n\n@media screen and (max-width: 500px) {\n  .productDetail .visual{\n    width: 100%;\n  }\n}\n\nfooter{\n  max-width: 1200px;\n  margin: auto;\n  text-align: center;\n  padding: 20px;\n  height: 70px;\n  font-size: 18px;\n  border-top: 1px solid #EEEEEE;\n}"
  },
  {
    "path": "060/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer } from \"./components\";\n\nimport './App.css';\n\nfunction App() {\n\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "060/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <Link to=\"/\">2030 Routemate</Link>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Routemate Logo\" />\r\n        <span>Routemate</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/products\" className=\"link\">Products</NavLink>\r\n        <NavLink to=\"/contact\" className=\"link\">Contact</NavLink>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";"
  },
  {
    "path": "060/src/data/data.js",
    "content": "export const products = [\r\n    {id: 1001, \"name\": \"Product 1\", \"price\": 149, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1002, \"name\": \"Product 2\", \"price\": 49, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1003, \"name\": \"Product 3\", \"price\": 179, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1004, \"name\": \"Product 4\", \"price\": 39, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1005, \"name\": \"Product 5\", \"price\": 199, \"image\": \"/assets/images/placeholder.jpg\",}, \r\n    {id: 1006, \"name\": \"Product 6\", \"price\": 29, \"image\": \"/assets/images/placeholder.jpg\"}\r\n]"
  },
  {
    "path": "060/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css\");\n\n:root{\n  --box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n  min-height: 90vh;\n  max-width: 1280px;\n  margin: auto;\n  padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}\n\nbutton{\n  border: 0px;\n  padding: 5px 10px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  cursor: pointer;\n  border-radius: 5px;\n}"
  },
  {
    "path": "060/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "060/src/pages/Admin.js",
    "content": "export const Admin = () => {\r\n  return (\r\n    <main>\r\n      <div className=\"component\">Welcome To Admin Section</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/Contact/Contact.js",
    "content": "import { useNavigate, Outlet } from \"react-router-dom\";\r\n\r\nexport const Contact = () => {\r\n  const navigate = useNavigate();\r\n\r\n  const handleSubmit = () => {\r\n    console.log(\"------\");\r\n    return navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <div className=\"component\">Contact</div>\r\n      <Outlet />\r\n      <button onClick={handleSubmit}>Submit Form</button>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/Contact/ContactEu.js",
    "content": "export const ContactEu = () => {\r\n  return (\r\n    <div className=\"component\">ContactEu</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/Contact/ContactIn.js",
    "content": "export const ContactIn = () => {\r\n  return (\r\n    <div className=\"component\">ContactIn</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/Contact/ContactUs.js",
    "content": "export const ContactUs = () => {\r\n  return (\r\n    <div className=\"component\">ContactUs</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/Home.js",
    "content": "export const Home = () => {\r\n  return (\r\n    <main>\r\n      <div className=\"component\">Home</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <div className=\"component\">404 Opps!</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/ProductDetail.js",
    "content": "import { useParams } from \"react-router-dom\";\r\n\r\nexport const ProductDetail = () => {\r\n  const params = useParams();\r\n\r\n  return (\r\n    <main>\r\n      <div className=\"component\">ProductDetail - {params.id}</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/ProductList.js",
    "content": "import { useSearchParams, useLocation } from \"react-router-dom\";\r\n\r\nexport const ProductList = () => {\r\n  const [searchParams] = useSearchParams();\r\n  // console.log(searchParams.get(\"keyword\"));\r\n\r\n  const location = useLocation();\r\n  // console.log(location);\r\n\r\n  return (\r\n    <main>\r\n      <div className=\"component\">ProductList</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "060/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\r\nexport { Admin } from \"./Admin\";\r\n\r\nexport { ProductList } from \"./ProductList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { Contact } from \"./Contact/Contact\";\r\nexport { ContactIn } from \"./Contact/ContactIn\";\r\nexport { ContactUs } from \"./Contact/ContactUs\";\r\nexport { ContactEu } from \"./Contact/ContactEu\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "060/src/routes/AllRoutes.js",
    "content": "import { Routes, Route, Navigate } from \"react-router-dom\";\r\nimport { Home, Admin, ProductList, ProductDetail, Contact, ContactIn, ContactEu, ContactUs, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  const user = true;\r\n  \r\n  return (\r\n    <>\r\n        <Routes>\r\n          <Route path=\"/\" element={<Home />} />\r\n          <Route path=\"products\" element={<ProductList />} />\r\n          <Route path=\"products/:id\" element={<ProductDetail />} />\r\n          <Route path=\"contact\" element={<Contact />} >\r\n            <Route path=\"in\" element={<ContactIn />} />\r\n            <Route path=\"eu\" element={<ContactEu />} />\r\n            <Route path=\"us\" element={<ContactUs />} />\r\n          </Route>\r\n          <Route path=\"admin\" element={ user ? <Admin /> : <Navigate to=\"/\" />} />\r\n          <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "063/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "063/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "063/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "063/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "063/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "063/src/App.css",
    "content": ""
  },
  {
    "path": "063/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "063/src/components/Card.js",
    "content": "export const Card = () => {\r\n  return (\r\n    <div>Card</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/components/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <footer>Footer</footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/components/Header.js",
    "content": "export const Header = () => {\r\n  return (\r\n    <header>Header</header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "063/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;"
  },
  {
    "path": "063/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "063/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/pages/MovieList.js",
    "content": "export const MovieList = () => {\r\n  return (\r\n    <main>\r\n      <div className=\"text-9xl bg-emerald-200 p-10 border-8 border-blue-700 rounded-lg m-5\">\r\n        MovieList\r\n      </div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "063/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList />} />\r\n            <Route path=\"movies/top\" element={<MovieList />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "063/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "064/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "064/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "064/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "064/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "064/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "064/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "064/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "064/src/App.css",
    "content": ""
  },
  {
    "path": "064/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "064/src/components/Card.js",
    "content": "export const Card = () => {\r\n  return (\r\n    <div>Card</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/components/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <footer>Footer</footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/components/Header.js",
    "content": "export const Header = () => {\r\n  return (\r\n    <header>Header</header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "064/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;"
  },
  {
    "path": "064/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "064/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/pages/MovieList.js",
    "content": "export const MovieList = () => {\r\n  return (\r\n    <main>\r\n      <div className=\"text-9xl bg-emerald-200 p-10 border-8 border-blue-700 rounded-lg m-5\">\r\n        MovieList\r\n      </div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "064/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList />} />\r\n            <Route path=\"movies/top\" element={<MovieList />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "064/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "065/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "065/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "065/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "065/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "065/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "065/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "065/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "065/src/App.css",
    "content": ""
  },
  {
    "path": "065/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "065/src/components/Card.js",
    "content": "export const Card = () => {\r\n  return (\r\n    <div>Card</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-gray-200 px-2 sm:px-4 py-2.5 rounded dark:bg-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n        <Link to=\"/\" className=\"flex items-center\">\r\n            <img src={Logo} className=\"mr-3 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n            <span className=\"self-center text-xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n        </Link>\r\n        <div className=\"flex md:order-2\">\r\n          <button type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n            <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n            <span className=\"sr-only\">Search</span>\r\n          </button>\r\n          <div className=\"hidden relative md:block\">\r\n            <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n              <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search icon</span>\r\n            </div>\r\n            <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" />\r\n          </div>\r\n          <button data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n            <span className=\"sr-only\">Open menu</span>\r\n            <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n          </button>\r\n        </div>\r\n          <div className=\"hidden justify-between items-center w-full md:flex md:w-auto md:order-1\" id=\"navbar-search\">\r\n            <div className=\"relative mt-3 md:hidden\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              </div>\r\n              <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" />\r\n            </div>\r\n            <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n              <li>\r\n                <NavLink to=\"/\" className=\"block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\" end>Home</NavLink>\r\n              </li>\r\n              <li>\r\n                <NavLink to=\"/movies/popular\" className=\"block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\">Popular</NavLink>\r\n              </li>\r\n              <li>\r\n                <NavLink to=\"/movies/top\" className=\"block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\">Top Rated</NavLink>\r\n              </li>\r\n              <li>\r\n                <NavLink to=\"/movies/upcoming\" className=\"block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\">Upcoming</NavLink>\r\n              </li>\r\n            </ul>\r\n          </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "065/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;"
  },
  {
    "path": "065/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "065/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/pages/MovieList.js",
    "content": "export const MovieList = () => {\r\n  return (\r\n    <main>\r\n      <div className=\"text-9xl bg-emerald-200 p-10 border-8 border-blue-700 rounded-lg m-5\">\r\n        MovieList\r\n      </div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "065/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList />} />\r\n            <Route path=\"movies/top\" element={<MovieList />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "065/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "067/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "067/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "067/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "067/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "067/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "067/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "067/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "067/src/App.css",
    "content": ""
  },
  {
    "path": "067/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "067/src/components/Card.js",
    "content": "export const Card = () => {\r\n  return (\r\n    <div>Card</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2.5 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-3 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "067/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "067/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "067/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/pages/MovieList.js",
    "content": "export const MovieList = () => {\r\n  return (\r\n    <main>MovieList</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "067/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList />} />\r\n            <Route path=\"movies/top\" element={<MovieList />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "067/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "068/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "068/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "068/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "068/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "068/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "068/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "068/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "068/src/App.css",
    "content": ""
  },
  {
    "path": "068/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "068/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Card = () => {\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to=\"#\">\r\n            <img className=\"rounded-t-lg\" src=\"\" alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to=\"#\">\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">Noteworthy technology acquisitions 2021</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.</p>\r\n            <Link to=\"#\" className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n                Read more\r\n                <svg aria-hidden=\"true\" className=\"ml-2 -mr-1 w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n            </Link>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2.5 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-3 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "068/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "068/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "068/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/pages/MovieList.js",
    "content": "import { Card } from \"../components\";\r\n\r\nexport const MovieList = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          <Card />\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "068/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-slate-800\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList />} />\r\n            <Route path=\"movies/top\" element={<MovieList />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "068/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "069/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "069/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "069/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "069/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "069/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "069/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "069/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "069/src/App.css",
    "content": ""
  },
  {
    "path": "069/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "069/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2.5 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-3 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "069/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "069/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "069/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/pages/MovieList.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = () => {\r\n  const [movies, setMovies] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchMovies(){\r\n      const response = await fetch(\"https://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\");\r\n      const data = await response.json();\r\n      setMovies(data.results);\r\n    }\r\n    fetchMovies();\r\n  }, [])\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "069/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-slate-800\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList />} />\r\n            <Route path=\"movies/top\" element={<MovieList />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "069/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "070/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "070/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "070/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "070/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "070/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "070/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "070/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "070/src/App.css",
    "content": ""
  },
  {
    "path": "070/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "070/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2.5 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-3 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <input type=\"text\" id=\"search-navbar\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "070/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath) => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "070/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "070/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "070/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = ({apiPath}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/pages/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <main>Search</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "070/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-slate-800\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" />} />\r\n            <Route path=\"search\" element={<Search />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "070/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "071/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "071/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "071/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "071/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "071/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "071/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "071/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "071/src/App.css",
    "content": ""
  },
  {
    "path": "071/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "071/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2.5 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-3 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "071/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "071/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "071/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "071/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = ({apiPath}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "071/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-slate-800\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "071/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {},\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "072/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "072/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "072/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "072/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "072/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "072/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "072/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "072/src/App.css",
    "content": ""
  },
  {
    "path": "072/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "072/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";"
  },
  {
    "path": "072/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "072/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "072/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "072/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = ({apiPath}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>PageNotFound</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "072/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "072/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "073/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "073/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "073/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "073/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "073/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "073/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "073/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "073/src/App.css",
    "content": ""
  },
  {
    "path": "073/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "073/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\n\r\nexport { Button } from \"./Button\";"
  },
  {
    "path": "073/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "073/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "073/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "073/src/pages/MovieDetail.js",
    "content": "export const MovieDetail = () => {\r\n  return (\r\n    <main>MovieDetail</main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = ({apiPath}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "073/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "073/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "074/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "074/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "074/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "074/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "074/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "074/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "074/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "074/src/App.css",
    "content": ""
  },
  {
    "path": "074/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "074/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\n\r\nexport { Button } from \"./Button\";"
  },
  {
    "path": "074/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "074/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "074/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "074/src/pages/MovieDetail.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const MovieDetail = () => {\r\n  const params = useParams();\r\n  const [movie, setMovie] = useState({});\r\n  const image = movie.poster_path ? `https://image.tmdb.org/t/p/w500/${movie.poster_path}` : Backup ;\r\n\r\n  useEffect(() => {\r\n    async function fetchMovie(){\r\n      const response = await fetch(`https://api.themoviedb.org/3/movie/${params.id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a`);\r\n      const json = await response.json()\r\n      setMovie(json);\r\n      console.log(json);\r\n    }\r\n    fetchMovie();\r\n  }, [])\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex justify-around flex-wrap py-5\">\r\n        <div className=\"max-w-sm\">\r\n          <img className=\"rounded\" src={image} alt={movie.title} />\r\n        </div>\r\n        <div className=\"max-w-2xl text-gray-700 text-lg dark:text-white\">\r\n          <h1 className=\"text-4xl font-bold my-3 text-center lg:text-left\">{movie.title}</h1>\r\n          <p className=\"my-4\">{movie.overview}</p>\r\n            { movie.genres ? (\r\n              <p className=\"my-7 flex flex-wrap gap-2\">\r\n              { movie.genres.map((genre) => (\r\n                <span className=\"mr-2 border border-gray-200 rounded dark:border-gray-600 p-2\" key={genre.id}>{genre.name}</span>\r\n              )) }\r\n            </p>\r\n            ) : \"\" }\r\n          \r\n          <div className=\"flex items-center\">\r\n              <svg aria-hidden=\"true\" className=\"w-5 h-5 text-yellow-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><title>Rating star</title><path d=\"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\"></path></svg>\r\n              <p className=\"ml-2 text-gray-900 dark:text-white\">{movie.vote_average}</p>\r\n              <span className=\"w-1 h-1 mx-1.5 bg-gray-500 rounded-full dark:bg-gray-400\"></span>\r\n              <span className=\"text-gray-900 dark:text-white\">{movie.vote_count} reviews</span>\r\n          </div>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Runtime:</span>\r\n            <span>{movie.runtime} min.</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Budget:</span>\r\n            <span>{movie.budget}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Revenue:</span>\r\n            <span>{movie.revenue}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Release Date:</span>\r\n            <span>{movie.release_date}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">IMDB Code:</span>\r\n            <a href={`https://www.imdb.com/title/${movie.imdb_id}`} target=\"_blank\" rel=\"noreferrer\">{movie.imdb_id}</a>\r\n          </p>\r\n\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = ({apiPath}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "074/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "074/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "075/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "075/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "075/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "075/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "075/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "075/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "075/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "075/src/App.css",
    "content": ""
  },
  {
    "path": "075/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "075/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/components/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport function ScrollToTop() {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "075/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\nexport { Button } from \"./Button\";\r\n\r\nexport { ScrollToTop } from \"./ScrollToTop\";"
  },
  {
    "path": "075/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "075/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "075/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "075/src/pages/MovieDetail.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const MovieDetail = () => {\r\n  const params = useParams();\r\n  const [movie, setMovie] = useState({});\r\n  const image = movie.poster_path ? `https://image.tmdb.org/t/p/w500/${movie.poster_path}` : Backup ;\r\n\r\n  useEffect(() => {\r\n    async function fetchMovie(){\r\n      const response = await fetch(`https://api.themoviedb.org/3/movie/${params.id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a`);\r\n      const json = await response.json()\r\n      setMovie(json);\r\n      console.log(json);\r\n    }\r\n    fetchMovie();\r\n  }, [])\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex justify-around flex-wrap py-5\">\r\n        <div className=\"max-w-sm\">\r\n          <img className=\"rounded\" src={image} alt={movie.title} />\r\n        </div>\r\n        <div className=\"max-w-2xl text-gray-700 text-lg dark:text-white\">\r\n          <h1 className=\"text-4xl font-bold my-3 text-center lg:text-left\">{movie.title}</h1>\r\n          <p className=\"my-4\">{movie.overview}</p>\r\n            { movie.genres ? (\r\n              <p className=\"my-7 flex flex-wrap gap-2\">\r\n              { movie.genres.map((genre) => (\r\n                <span className=\"mr-2 border border-gray-200 rounded dark:border-gray-600 p-2\" key={genre.id}>{genre.name}</span>\r\n              )) }\r\n            </p>\r\n            ) : \"\" }\r\n          \r\n          <div className=\"flex items-center\">\r\n              <svg aria-hidden=\"true\" className=\"w-5 h-5 text-yellow-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><title>Rating star</title><path d=\"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\"></path></svg>\r\n              <p className=\"ml-2 text-gray-900 dark:text-white\">{movie.vote_average}</p>\r\n              <span className=\"w-1 h-1 mx-1.5 bg-gray-500 rounded-full dark:bg-gray-400\"></span>\r\n              <span className=\"text-gray-900 dark:text-white\">{movie.vote_count} reviews</span>\r\n          </div>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Runtime:</span>\r\n            <span>{movie.runtime} min.</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Budget:</span>\r\n            <span>{movie.budget}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Revenue:</span>\r\n            <span>{movie.revenue}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Release Date:</span>\r\n            <span>{movie.release_date}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">IMDB Code:</span>\r\n            <a href={`https://www.imdb.com/title/${movie.imdb_id}`} target=\"_blank\" rel=\"noreferrer\">{movie.imdb_id}</a>\r\n          </p>\r\n\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const MovieList = ({apiPath}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "075/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "075/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "076/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "076/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "076/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "076/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "076/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "076/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "076/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "076/src/App.css",
    "content": ""
  },
  {
    "path": "076/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "076/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"container flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-6 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/components/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport function ScrollToTop() {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "076/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\nexport { Button } from \"./Button\";\r\n\r\nexport { ScrollToTop } from \"./ScrollToTop\";"
  },
  {
    "path": "076/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "076/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} / Cinemate`;\r\n    });\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "076/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "076/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "076/src/pages/MovieDetail.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const MovieDetail = () => {\r\n  const params = useParams();\r\n  const [movie, setMovie] = useState({});\r\n  const pageTitle = useTitle(movie.title);\r\n\r\n  const image = movie.poster_path ? `https://image.tmdb.org/t/p/w500/${movie.poster_path}` : Backup ;\r\n\r\n  useEffect(() => {\r\n    async function fetchMovie(){\r\n      const response = await fetch(`https://api.themoviedb.org/3/movie/${params.id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a`);\r\n      const json = await response.json()\r\n      setMovie(json);\r\n      console.log(json);\r\n    }\r\n    fetchMovie();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex justify-around flex-wrap py-5\">\r\n        <div className=\"max-w-sm\">\r\n          <img className=\"rounded\" src={image} alt={movie.title} />\r\n        </div>\r\n        <div className=\"max-w-2xl text-gray-700 text-lg dark:text-white\">\r\n          <h1 className=\"text-4xl font-bold my-3 text-center lg:text-left\">{movie.title}</h1>\r\n          <p className=\"my-4\">{movie.overview}</p>\r\n            { movie.genres ? (\r\n              <p className=\"my-7 flex flex-wrap gap-2\">\r\n              { movie.genres.map((genre) => (\r\n                <span className=\"mr-2 border border-gray-200 rounded dark:border-gray-600 p-2\" key={genre.id}>{genre.name}</span>\r\n              )) }\r\n            </p>\r\n            ) : \"\" }\r\n          \r\n          <div className=\"flex items-center\">\r\n              <svg aria-hidden=\"true\" className=\"w-5 h-5 text-yellow-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><title>Rating star</title><path d=\"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\"></path></svg>\r\n              <p className=\"ml-2 text-gray-900 dark:text-white\">{movie.vote_average}</p>\r\n              <span className=\"w-1 h-1 mx-1.5 bg-gray-500 rounded-full dark:bg-gray-400\"></span>\r\n              <span className=\"text-gray-900 dark:text-white\">{movie.vote_count} reviews</span>\r\n          </div>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Runtime:</span>\r\n            <span>{movie.runtime} min.</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Budget:</span>\r\n            <span>{movie.budget}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Revenue:</span>\r\n            <span>{movie.revenue}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Release Date:</span>\r\n            <span>{movie.release_date}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">IMDB Code:</span>\r\n            <a href={`https://www.imdb.com/title/${movie.imdb_id}`} target=\"_blank\" rel=\"noreferrer\">{movie.imdb_id}</a>\r\n          </p>\r\n\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\n\r\nexport const MovieList = ({apiPath, title}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n  const pageTitle = useTitle(title);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/pages/PageNotFound.js",
    "content": "import { useEffect } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n\r\n  useEffect(() => {\r\n    document.title = `Page Not Found / Cinemate`;\r\n  });\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  const pageTitle = useTitle(`Search result for ${queryTerm}`);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "076/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" title=\"Home\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" title=\"Popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" title=\"Top Rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" title=\"Upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "076/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "077/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "077/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "077/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "077/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "077/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "077/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "077/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "077/src/App.css",
    "content": ""
  },
  {
    "path": "077/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "077/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"#\" target=\"_blank\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-8 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/components/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport function ScrollToTop() {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "077/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\nexport { Button } from \"./Button\";\r\n\r\nexport { ScrollToTop } from \"./ScrollToTop\";"
  },
  {
    "path": "077/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "077/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} / Cinemate`;\r\n    });\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "077/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "077/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "077/src/pages/MovieDetail.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const MovieDetail = () => {\r\n  const params = useParams();\r\n  const [movie, setMovie] = useState({});\r\n  const pageTitle = useTitle(movie.title);\r\n\r\n  const image = movie.poster_path ? `https://image.tmdb.org/t/p/w500/${movie.poster_path}` : Backup ;\r\n\r\n  useEffect(() => {\r\n    async function fetchMovie(){\r\n      const response = await fetch(`https://api.themoviedb.org/3/movie/${params.id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a`);\r\n      const json = await response.json()\r\n      setMovie(json);\r\n      console.log(json);\r\n    }\r\n    fetchMovie();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex justify-around flex-wrap py-5\">\r\n        <div className=\"max-w-sm\">\r\n          <img className=\"rounded\" src={image} alt={movie.title} />\r\n        </div>\r\n        <div className=\"max-w-2xl text-gray-700 text-lg dark:text-white\">\r\n          <h1 className=\"text-4xl font-bold my-3 text-center lg:text-left\">{movie.title}</h1>\r\n          <p className=\"my-4\">{movie.overview}</p>\r\n            { movie.genres ? (\r\n              <p className=\"my-7 flex flex-wrap gap-2\">\r\n              { movie.genres.map((genre) => (\r\n                <span className=\"mr-2 border border-gray-200 rounded dark:border-gray-600 p-2\" key={genre.id}>{genre.name}</span>\r\n              )) }\r\n            </p>\r\n            ) : \"\" }\r\n          \r\n          <div className=\"flex items-center\">\r\n              <svg aria-hidden=\"true\" className=\"w-5 h-5 text-yellow-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><title>Rating star</title><path d=\"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\"></path></svg>\r\n              <p className=\"ml-2 text-gray-900 dark:text-white\">{movie.vote_average}</p>\r\n              <span className=\"w-1 h-1 mx-1.5 bg-gray-500 rounded-full dark:bg-gray-400\"></span>\r\n              <span className=\"text-gray-900 dark:text-white\">{movie.vote_count} reviews</span>\r\n          </div>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Runtime:</span>\r\n            <span>{movie.runtime} min.</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Budget:</span>\r\n            <span>{movie.budget}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Revenue:</span>\r\n            <span>{movie.revenue}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Release Date:</span>\r\n            <span>{movie.release_date}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">IMDB Code:</span>\r\n            <a href={`https://www.imdb.com/title/${movie.imdb_id}`} target=\"_blank\" rel=\"noreferrer\">{movie.imdb_id}</a>\r\n          </p>\r\n\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\n\r\nexport const MovieList = ({apiPath, title}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n  const pageTitle = useTitle(title);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/pages/PageNotFound.js",
    "content": "import { useEffect } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n\r\n  useEffect(() => {\r\n    document.title = `Page Not Found / Cinemate`;\r\n  });\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  const pageTitle = useTitle(`Search result for ${queryTerm}`);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "077/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" title=\"Home\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" title=\"Popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" title=\"Top Rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" title=\"Upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "077/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "078/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "078/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "078/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "078/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "078/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "078/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "078/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "078/src/App.css",
    "content": ""
  },
  {
    "path": "078/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "078/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"https://www.instagram.com/shubham.ul/\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://www.linkedin.com/in/shubhamsarda/\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://twitter.com/shubham_ul\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6\">Twitter</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://www.youtube.com/channel/UCuH_UB-L_PaVQSBoOqp0cqw\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://github.com/ShubhamSarda\" target=\"_blank\" rel=\"noreferrer\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n              \r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-8 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/components/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport function ScrollToTop() {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "078/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\nexport { Button } from \"./Button\";\r\n\r\nexport { ScrollToTop } from \"./ScrollToTop\";"
  },
  {
    "path": "078/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "078/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} / Cinemate`;\r\n    });\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "078/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "078/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "078/src/pages/MovieDetail.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const MovieDetail = () => {\r\n  const params = useParams();\r\n  const [movie, setMovie] = useState({});\r\n  \r\n  //eslint-disable-next-line\r\n  const pageTitle = useTitle(movie.title);\r\n\r\n  const image = movie.poster_path ? `https://image.tmdb.org/t/p/w500/${movie.poster_path}` : Backup ;\r\n\r\n  useEffect(() => {\r\n    async function fetchMovie(){\r\n      const response = await fetch(`https://api.themoviedb.org/3/movie/${params.id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a`);\r\n      const json = await response.json()\r\n      setMovie(json);\r\n      console.log(json);\r\n    }\r\n    fetchMovie();\r\n  }, [params.id]);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex justify-around flex-wrap py-5\">\r\n        <div className=\"max-w-sm\">\r\n          <img className=\"rounded\" src={image} alt={movie.title} />\r\n        </div>\r\n        <div className=\"max-w-2xl text-gray-700 text-lg dark:text-white\">\r\n          <h1 className=\"text-4xl font-bold my-3 text-center lg:text-left\">{movie.title}</h1>\r\n          <p className=\"my-4\">{movie.overview}</p>\r\n            { movie.genres ? (\r\n              <p className=\"my-7 flex flex-wrap gap-2\">\r\n              { movie.genres.map((genre) => (\r\n                <span className=\"mr-2 border border-gray-200 rounded dark:border-gray-600 p-2\" key={genre.id}>{genre.name}</span>\r\n              )) }\r\n            </p>\r\n            ) : \"\" }\r\n          \r\n          <div className=\"flex items-center\">\r\n              <svg aria-hidden=\"true\" className=\"w-5 h-5 text-yellow-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><title>Rating star</title><path d=\"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\"></path></svg>\r\n              <p className=\"ml-2 text-gray-900 dark:text-white\">{movie.vote_average}</p>\r\n              <span className=\"w-1 h-1 mx-1.5 bg-gray-500 rounded-full dark:bg-gray-400\"></span>\r\n              <span className=\"text-gray-900 dark:text-white\">{movie.vote_count} reviews</span>\r\n          </div>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Runtime:</span>\r\n            <span>{movie.runtime} min.</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Budget:</span>\r\n            <span>{movie.budget}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Revenue:</span>\r\n            <span>{movie.revenue}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Release Date:</span>\r\n            <span>{movie.release_date}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">IMDB Code:</span>\r\n            <a href={`https://www.imdb.com/title/${movie.imdb_id}`} target=\"_blank\" rel=\"noreferrer\">{movie.imdb_id}</a>\r\n          </p>\r\n\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\n\r\nexport const MovieList = ({apiPath, title}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n  useTitle(title);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/pages/PageNotFound.js",
    "content": "import { useEffect } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n\r\n  useEffect(() => {\r\n    document.title = `Page Not Found / Cinemate`;\r\n  });\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  useTitle(`Search result for ${queryTerm}`);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "078/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" title=\"Home\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" title=\"Popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" title=\"Top Rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" title=\"Upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "078/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "079/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "079/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "079/links.txt",
    "content": "API Key: b80d59c33d6d57ed9c7e3713f91c188a\r\nBase URL: https://api.themoviedb.org/3\r\n\r\nIndividual:\r\nhttps://api.themoviedb.org/3/movie/{movie_id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nNow Playing:\r\nhttps://api.themoviedb.org/3/movie/now_playing?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nPopular:\r\nhttps://api.themoviedb.org/3/movie/popular?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nTop Rated:\r\nhttps://api.themoviedb.org/3/movie/top_rated?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nUpcoming: \r\nhttps://api.themoviedb.org/3/movie/upcoming?api_key=b80d59c33d6d57ed9c7e3713f91c188a\r\n\r\nSearch:\r\nhttps://api.themoviedb.org/3/search/movie?api_key=b80d59c33d6d57ed9c7e3713f91c188a&query={movie_name}"
  },
  {
    "path": "079/netlify.toml",
    "content": "[[redirects]]\r\nfrom = \"/*\"\r\nto = \"/index.html\"\r\nstatus = 200"
  },
  {
    "path": "079/package.json",
    "content": "{\n  \"name\": \"cinemate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "079/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Cinemate</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "079/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "079/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "079/src/App.css",
    "content": ""
  },
  {
    "path": "079/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header, Footer} from \"./components\"\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "079/src/components/Button.js",
    "content": "export const Button = ({children}) => {\r\n  return (\r\n    <button className=\"w-64 text-xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 rounded-lg px-5 py-2.5 mr-2 mb-2 font-medium\">{children}</button>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/components/Card.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const Card = ({movie}) => {\r\n  const {id, original_title, overview, poster_path} = movie;\r\n  const image = poster_path ? `https://image.tmdb.org/t/p/w500/${poster_path}` : Backup ;\r\n\r\n  return (\r\n    <div className=\"max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700 m-3\">\r\n        <Link to={`/movie/${id}`}>\r\n            <img className=\"rounded-t-lg\" src={image} alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/movie/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{original_title}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n      <footer className=\"p-4 bg-white shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800\">\r\n          <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">Cinemate</Link>. All Rights Reserved.</span>\r\n          <ul className=\"flex flex-wrap items-center mt-3 text-sm text-gray-500 dark:text-gray-400 sm:mt-0\">\r\n              <li>\r\n                  <a href=\"https://www.instagram.com/shubham.ul/\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6 \">Instagram</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://www.linkedin.com/in/shubhamsarda/\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6\">LinkedIn</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://twitter.com/shubham_ul\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6\">Twitter</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://www.youtube.com/channel/UCuH_UB-L_PaVQSBoOqp0cqw\" target=\"_blank\" rel=\"noreferrer\" className=\"mr-4 hover:underline md:mr-6\">Youtube</a>\r\n              </li>\r\n              <li>\r\n                  <a href=\"https://github.com/ShubhamSarda\" target=\"_blank\" rel=\"noreferrer\" className=\"hover:underline\">Github</a>\r\n              </li>\r\n              \r\n          </ul>\r\n      </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/components/Header.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link, NavLink, useNavigate } from \"react-router-dom\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [hidden, setHidden] = useState(true);\r\n  const [darkMode, setDarkMode] = useState( JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n\r\n    if(darkMode){\r\n      document.documentElement.classList.add('dark');\r\n    } else {\r\n      document.documentElement.classList.remove('dark');\r\n    }\r\n    \r\n  }, [darkMode]);\r\n\r\n  const activeClass = \"text-base block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white\";\r\n  const inActiveClass = \"text-base block py-2 pr-4 pl-3 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700\";\r\n\r\n  const handleSubmit = (event) => {\r\n    event.preventDefault();\r\n    const queryTerm = event.target.search.value;\r\n    event.target.reset();\r\n    return navigate(`/search?q=${queryTerm}`);\r\n  }\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white border-b-2 border-gray-200 px-2 sm:px-4 py-2 dark:bg-gray-900 dark:border-b-1 dark:border-gray-900\">\r\n        <div className=\"flex flex-wrap justify-between items-center mx-auto\">\r\n          <Link to=\"/\" className=\"flex items-center\">\r\n              <img src={Logo} className=\"mr-2 h-8 sm:h-9\" alt=\"Cinemate Logo\" />\r\n              <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">Cinemate</span>\r\n          </Link>\r\n\r\n          <div id=\"mobile-nav\" className=\"flex md:order-2\">\r\n          <button onClick={() => setDarkMode(!darkMode)} data-tooltip-target=\"navbar-search-example-toggle-dark-mode-tooltip\" type=\"button\" data-toggle-dark=\"light\" className=\"flex items-center p-2 mr-2 text-xs font-medium text-gray-700 bg-white rounded-lg border border-gray-200 toggle-dark-state-example hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 dark:bg-gray-800 focus:outline-none dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700\">\r\n            { darkMode ? (<svg aria-hidden=\"true\" data-toggle-icon=\"sun\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><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\" fillRule=\"evenodd\" clipRule=\"evenodd\"></path></svg>) : (<svg aria-hidden=\"true\" data-toggle-icon=\"moon\" className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\"></path></svg>) }\r\n          </button>\r\n            <button onClick={() => setHidden(!hidden)} type=\"button\" data-collapse-toggle=\"navbar-search\" aria-controls=\"navbar-search\" aria-expanded=\"false\" className=\"md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1\">\r\n              <svg className=\"w-5 h-5\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n              <span className=\"sr-only\">Search</span>\r\n            </button>\r\n            <div className=\"hidden relative md:block\">\r\n              <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                <span className=\"sr-only\">Search icon</span>\r\n              </div>\r\n              <form onSubmit={handleSubmit}>\r\n                <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n              </form>\r\n            </div>\r\n            <button onClick={() => setHidden(!hidden)} data-collapse-toggle=\"navbar-search\" type=\"button\" className=\"inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600\" aria-controls=\"navbar-search\" aria-expanded=\"false\">\r\n              <span className=\"sr-only\">Open menu</span>\r\n              <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z\" clipRule=\"evenodd\"></path></svg>\r\n            </button>\r\n          </div>\r\n\r\n            <div className={`${hidden ? \"hidden\" : \"\"} justify-between items-center w-full md:flex md:w-auto md:order-1`} id=\"navbar-search\">\r\n              <div className=\"relative mt-3 md:hidden\">\r\n                <div className=\"flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\">\r\n                  <svg className=\"w-5 h-5 text-gray-500\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\" clipRule=\"evenodd\"></path></svg>\r\n                </div>\r\n                <form onSubmit={handleSubmit}>\r\n                  <input type=\"text\" id=\"search-navbar\" name=\"search\" className=\"block p-2 pl-10 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 sm:text-sm focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search...\" autoComplete=\"off\" />\r\n                </form>\r\n              </div>\r\n              <ul className=\"flex flex-col p-4 mt-4 bg-gray-50 rounded-lg border border-gray-100 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700\">\r\n                <li>\r\n                  <NavLink to=\"/\" className={({isActive}) => isActive ? activeClass : inActiveClass } end>Home</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/popular\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Popular</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/top\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Top Rated</NavLink>\r\n                </li>\r\n                <li>\r\n                  <NavLink to=\"/movies/upcoming\" className={({isActive}) => isActive ? activeClass : inActiveClass }>Upcoming</NavLink>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n        </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/components/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport function ScrollToTop() {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "079/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\n\r\nexport { Card } from \"./Card\";\r\nexport { Button } from \"./Button\";\r\n\r\nexport { ScrollToTop } from \"./ScrollToTop\";"
  },
  {
    "path": "079/src/hooks/useFetch.js",
    "content": "import { useState, useEffect } from \"react\";\r\n\r\nexport const useFetch = (apiPath, queryTerm=\"\") => {\r\n    const [data, setData] = useState([]);\r\n    const url = `https://api.themoviedb.org/3/${apiPath}?api_key=${process.env.REACT_APP_API_KEY}&query=${queryTerm}`\r\n\r\n    useEffect(() => {\r\n        async function fetchMovies(){\r\n          const response = await fetch(url);\r\n          const json = await response.json();\r\n          setData(json.results);\r\n        }\r\n        fetchMovies();\r\n      }, [url])\r\n\r\n  return { data }\r\n}"
  },
  {
    "path": "079/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} / Cinemate`;\r\n    });\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "079/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nmain{\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    min-height: 90vh;\r\n    padding: 10px;\r\n}"
  },
  {
    "path": "079/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "079/src/pages/MovieDetail.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Backup from \"../assets/images/backup.png\"\r\n\r\nexport const MovieDetail = () => {\r\n  const params = useParams();\r\n  const [movie, setMovie] = useState({});\r\n  \r\n  //eslint-disable-next-line\r\n  const pageTitle = useTitle(movie.title);\r\n\r\n  const image = movie.poster_path ? `https://image.tmdb.org/t/p/w500/${movie.poster_path}` : Backup ;\r\n\r\n  useEffect(() => {\r\n    async function fetchMovie(){\r\n      const response = await fetch(`https://api.themoviedb.org/3/movie/${params.id}?api_key=b80d59c33d6d57ed9c7e3713f91c188a`);\r\n      const json = await response.json()\r\n      setMovie(json);\r\n      console.log(json);\r\n    }\r\n    fetchMovie();\r\n  }, [params.id]);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex justify-around flex-wrap py-5\">\r\n        <div className=\"max-w-sm\">\r\n          <img className=\"rounded\" src={image} alt={movie.title} />\r\n        </div>\r\n        <div className=\"max-w-2xl text-gray-700 text-lg dark:text-white\">\r\n          <h1 className=\"text-4xl font-bold my-3 text-center lg:text-left\">{movie.title}</h1>\r\n          <p className=\"my-4\">{movie.overview}</p>\r\n            { movie.genres ? (\r\n              <p className=\"my-7 flex flex-wrap gap-2\">\r\n              { movie.genres.map((genre) => (\r\n                <span className=\"mr-2 border border-gray-200 rounded dark:border-gray-600 p-2\" key={genre.id}>{genre.name}</span>\r\n              )) }\r\n            </p>\r\n            ) : \"\" }\r\n          \r\n          <div className=\"flex items-center\">\r\n              <svg aria-hidden=\"true\" className=\"w-5 h-5 text-yellow-400\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><title>Rating star</title><path d=\"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z\"></path></svg>\r\n              <p className=\"ml-2 text-gray-900 dark:text-white\">{movie.vote_average}</p>\r\n              <span className=\"w-1 h-1 mx-1.5 bg-gray-500 rounded-full dark:bg-gray-400\"></span>\r\n              <span className=\"text-gray-900 dark:text-white\">{movie.vote_count} reviews</span>\r\n          </div>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Runtime:</span>\r\n            <span>{movie.runtime} min.</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Budget:</span>\r\n            <span>{movie.budget}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Revenue:</span>\r\n            <span>{movie.revenue}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">Release Date:</span>\r\n            <span>{movie.release_date}</span>\r\n          </p>\r\n\r\n          <p className=\"my-4\">\r\n            <span className=\"mr-2 font-bold\">IMDB Code:</span>\r\n            <a href={`https://www.imdb.com/title/${movie.imdb_id}`} target=\"_blank\" rel=\"noreferrer\">{movie.imdb_id}</a>\r\n          </p>\r\n\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/pages/MovieList.js",
    "content": "import { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\n\r\nexport const MovieList = ({apiPath, title}) => {\r\n  const { data: movies } = useFetch(apiPath);\r\n  useTitle(title);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap other:justify-evenly\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/pages/PageNotFound.js",
    "content": "import { useEffect } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport PageNotFoundImage from \"../assets/images/pagenotfound.png\"\r\nimport { Button } from \"../components\";\r\n\r\nexport const PageNotFound = () => {\r\n\r\n  useEffect(() => {\r\n    document.title = `Page Not Found / Cinemate`;\r\n  });\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"flex flex-col justify-center px-2\">\r\n        <div className=\"flex flex-col items-center my-4\">\r\n          <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white\">404, Oops!</p>\r\n          <div className=\"max-w-lg\">\r\n            <img className=\"rounded\" src={PageNotFoundImage} alt=\"404 Page Not Found\" />\r\n          </div>\r\n        </div>\r\n        <div className=\"flex justify-center my-4\">\r\n          <Link to=\"/\">\r\n            <Button>Back To Cinemate</Button>\r\n          </Link>          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/pages/Search.js",
    "content": "import { useSearchParams } from \"react-router-dom\";\r\nimport { useFetch } from \"../hooks/useFetch\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Card } from \"../components\";\r\n\r\nexport const Search = ({apiPath}) => {\r\n  const [searchParams] = useSearchParams();\r\n  const queryTerm = searchParams.get(\"q\");\r\n  const { data: movies } = useFetch(apiPath, queryTerm);\r\n\r\n  useTitle(`Search result for ${queryTerm}`);\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"py-7\">\r\n        <p className=\"text-3xl text-gray-700 dark:text-white\">{ movies.length === 0 ? `No result found for '${queryTerm}'` : `Result for '${queryTerm}'` }</p>\r\n      </section>\r\n      <section className=\"max-w-7xl mx-auto py-7\">\r\n        <div className=\"flex justify-start flex-wrap\">       \r\n          { movies.map((movie) => (\r\n            <Card key={movie.id} movie={movie} />\r\n          )) }          \r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/src/pages/index.js",
    "content": "export { MovieList } from \"./MovieList\";\r\nexport { MovieDetail } from \"./MovieDetail\";\r\nexport { Search } from \"./Search\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "079/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { MovieList, MovieDetail, Search, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <div className=\"dark:bg-darkbg\">\r\n        <Routes>\r\n            <Route path=\"\" element={<MovieList apiPath=\"movie/now_playing\" title=\"Home\" />} />\r\n            <Route path=\"movie/:id\" element={<MovieDetail />} />\r\n            <Route path=\"movies/popular\" element={<MovieList apiPath=\"movie/popular\" title=\"Popular\" />} />\r\n            <Route path=\"movies/top\" element={<MovieList apiPath=\"movie/top_rated\" title=\"Top Rated\" />} />\r\n            <Route path=\"movies/upcoming\" element={<MovieList apiPath=\"movie/upcoming\" title=\"Upcoming\" />} />\r\n            <Route path=\"search\" element={<Search apiPath=\"search/movie\" />} />\r\n            <Route path=\"*\" element={<PageNotFound />} />\r\n        </Routes>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "079/tailwind.config.js",
    "content": "module.exports = {\r\n    content: [\"./src/**/*.{html,js}\"],\r\n    darkMode: 'class',\r\n    theme: {\r\n      extend: {\r\n        screens: {\r\n          \"other\": {'min': '340px', 'max': '1200px'},\r\n        },\r\n        colors: {\r\n          darkbg: \"#1E293B\",\r\n          blue: {\r\n            850: \"#1e40af\"\r\n          }\r\n        }\r\n      },\r\n    },\r\n    plugins: [],\r\n}"
  },
  {
    "path": "080/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "080/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "080/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "080/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "080/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "080/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "080/src/App.css",
    "content": "header {\n  display: flex;\n  justify-content: space-between;\n  height: 70px;\n  align-items: center;\n  max-width: 1200px;\n  margin: auto;\n  border-bottom: 1px solid #EEEEEE;\n  font-size: 18px;\n  padding: 0px 10px;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n  margin-right: 5px;\n}\n\n.navigation .link{\n  padding: 10px;\n}\n\n.navigation .link.active{\n  background-color: #EEEEEE;\n  border-radius: 5px;\n}\n\n.items{\n  font-weight: 500;\n  min-width: 70px;\n}\n\n@media screen and (max-width: 680px) {\n  .navigation{\n      display: none;\n  }\n}\n\n.products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.product{\n  width: 350px;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 10px;\n  padding: 10px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n}\n\n.product img{\n  max-width: 100%;\n  height: 250px;\n  margin: 10px 0px;\n}\n\n.product .name{\n  margin: 10px 0px;\n}\n\n.product p{\n  font-size: 18px;\n  font-weight: 500;\n}\n\n.product .action{\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin: 10px 0px;\n}\n\n.product button{\n  border: 0px;\n  border-radius: 5px;\n  font-size: 16px;\n  color: #FFFFFF;\n  background-color: #1C59AE;\n  padding: 7px 10px;\n  cursor: pointer;\n  max-width: 150px;\n}\n\n.product button:hover{\n  background-color: #103f80;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}\n\n.cartCard{\n  display: flex;    \n  justify-content: space-between;\n  align-items: center;\n  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n  border-radius: 5px;\n  margin: 30px 10px;\n  padding: 10px;\n}\n\n.cartCard img{\n  width: 150px;\n  height: 100px;\n  margin-right: 10px;\n}\n\n.cartCard .productName{\n  width: 350px;\n  margin-right: 10px;\n}\n\n.cartCard .productPrice{\n  width: 100px;\n  margin-right: 10px;\n}\n\n.cartCard button{\n  border: 0px;\n  background-color: #ac0d14;\n  color: #FFFFFF;\n  border-radius: 5px;\n  padding: 5px 10px;\n  cursor: pointer;\n}\n\n.cartCard button:hover{\n  background-color: #8e090f;\n}\n\n\n@media screen and (max-width: 680px) {\n  .cartCard img{\n      display: none;\n  }\n}"
  },
  {
    "path": "080/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Hello World!</h1>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "080/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "080/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "082/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "082/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "082/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "082/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "082/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "082/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "082/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "082/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "082/src/components/CartCard.css",
    "content": ".cartCard{\r\n    display: flex;    \r\n    justify-content: space-between;\r\n    align-items: center;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    margin: 30px 10px;\r\n    padding: 10px;\r\n  }\r\n  \r\n  .cartCard img{\r\n    width: 150px;\r\n    height: 100px;\r\n    margin-right: 10px;\r\n  }\r\n  \r\n  .cartCard .productName{\r\n    width: 350px;\r\n    margin-right: 10px;\r\n  }\r\n  \r\n  .cartCard .productPrice{\r\n    width: 100px;\r\n    margin-right: 10px;\r\n  }\r\n  \r\n  .cartCard button{\r\n    border: 0px;\r\n    background-color: #ac0d14;\r\n    color: #FFFFFF;\r\n    border-radius: 5px;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n  }\r\n  \r\n  .cartCard button:hover{\r\n    background-color: #8e090f;\r\n  }\r\n  \r\n  \r\n  @media screen and (max-width: 680px) {\r\n    .cartCard img{\r\n        display: none;\r\n    }\r\n  }"
  },
  {
    "path": "082/src/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div>CartCard</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "082/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid #EEEEEE;\r\n    font-size: 18px;\r\n    padding: 0px 10px;\r\n  }\r\n  \r\n  .logo{\r\n    display: flex;\r\n    align-items: center;\r\n  }\r\n  .logo img{\r\n    max-width: 40px;\r\n    margin-right: 5px;\r\n  }\r\n  \r\n  .navigation .link{\r\n    padding: 10px;\r\n  }\r\n  \r\n  .navigation .link.active{\r\n    background-color: #EEEEEE;\r\n    border-radius: 5px;\r\n  }\r\n  \r\n  .items{\r\n    font-weight: 500;\r\n    min-width: 70px;\r\n  }\r\n  \r\n  @media screen and (max-width: 680px) {\r\n    .navigation{\r\n        display: none;\r\n    }\r\n  }"
  },
  {
    "path": "082/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \r\nimport Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Shopmate Logo\" />\r\n        <span>Shopping Cart</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\r\n      </nav>\r\n      <Link to=\"/cart\" className=\"items\">\r\n        <span>Cart: 2</span>\r\n      </Link>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "082/src/components/ProductCard.css",
    "content": ".productCard{\r\n    width: 350px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    padding: 10px;\r\n    display: flex;\r\n    flex-direction: column;\r\n    justify-content: space-between;\r\n  }\r\n  \r\n  .productCard img{\r\n    max-width: 100%;\r\n    height: 250px;\r\n    margin: 10px 0px;\r\n  }\r\n  \r\n  .productCard .name{\r\n    margin: 10px 0px;\r\n  }\r\n  \r\n  .productCard p{\r\n    font-size: 18px;\r\n    font-weight: 500;\r\n  }\r\n  \r\n  .productCard .action{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 10px 0px;\r\n  }\r\n  \r\n  .productCard button{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    font-size: 16px;\r\n    color: #FFFFFF;\r\n    background-color: #1C59AE;\r\n    padding: 7px 10px;\r\n    cursor: pointer;\r\n    max-width: 150px;\r\n  }\r\n  \r\n  .productCard button:hover{\r\n    background-color: #103f80;\r\n  }"
  },
  {
    "path": "082/src/components/ProductCard.js",
    "content": "export const ProductCard = ({product}) => {\r\n  const {name, price, image} = product;\r\n\r\n  return (\r\n    <div className=\"productCard\">\r\n      <img src={image} alt={name} />\r\n      <p className=\"name\">{name}</p>\r\n      <div className=\"action\">\r\n        <p>{price}</p>\r\n        <button>Add To Cart</button>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "082/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\n\r\nexport { ProductCard } from \"./ProductCard\";\r\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "082/src/hooks/useTitle.js",
    "content": "export const useTitle = () => {\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "082/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "082/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "082/src/pages/Cart.js",
    "content": "export const Cart = () => {\r\n  return (\r\n    <div>Cart</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "082/src/pages/Home.js",
    "content": "import { ProductCard } from \"../components\";\r\n\r\nexport const Home = () => {\r\n  const products = [\r\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\r\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\r\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\r\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\r\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\r\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\r\n  ]\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"products\">\r\n        { products.map((product) => (\r\n          <ProductCard key={product.id} product={product} />\r\n        )) }        \r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "082/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\r\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "082/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { Home, Cart } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n      <Routes>\r\n        <Route path=\"/\" element={<Home />} />\r\n        <Route path=\"/cart\" element={<Cart />} />\r\n      </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "083/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "083/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "083/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "083/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "083/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "083/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "083/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "083/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "083/src/components/CartCard.css",
    "content": ".cartCard{\r\n    display: flex;    \r\n    justify-content: space-between;\r\n    align-items: center;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    margin: 30px 10px;\r\n    padding: 10px;\r\n  }\r\n  \r\n  .cartCard img{\r\n    width: 150px;\r\n    height: 100px;\r\n    margin-right: 10px;\r\n  }\r\n  \r\n  .cartCard .productName{\r\n    width: 350px;\r\n    margin-right: 10px;\r\n  }\r\n  \r\n  .cartCard .productPrice{\r\n    width: 100px;\r\n    margin-right: 10px;\r\n  }\r\n  \r\n  .cartCard button{\r\n    border: 0px;\r\n    background-color: #ac0d14;\r\n    color: #FFFFFF;\r\n    border-radius: 5px;\r\n    padding: 5px 10px;\r\n    cursor: pointer;\r\n  }\r\n  \r\n  .cartCard button:hover{\r\n    background-color: #8e090f;\r\n  }\r\n  \r\n  \r\n  @media screen and (max-width: 680px) {\r\n    .cartCard img{\r\n        display: none;\r\n    }\r\n  }"
  },
  {
    "path": "083/src/components/CartCard.js",
    "content": "import \"./CartCard.css\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const {name, price, image} = product;\r\n\r\n  return (\r\n      <div className=\"cartCard\">\r\n        <img src={image} alt={name} />\r\n        <p className=\"productName\">{name}</p>\r\n        <p className=\"productPrice\">${price}</p>\r\n        <button>Remove</button>\r\n      </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "083/src/components/Header.css",
    "content": "header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    height: 70px;\r\n    align-items: center;\r\n    max-width: 1200px;\r\n    margin: auto;\r\n    border-bottom: 1px solid #EEEEEE;\r\n    font-size: 18px;\r\n    padding: 0px 10px;\r\n  }\r\n  \r\n  .logo{\r\n    display: flex;\r\n    align-items: center;\r\n  }\r\n  .logo img{\r\n    max-width: 40px;\r\n    margin-right: 5px;\r\n  }\r\n  \r\n  .navigation .link{\r\n    padding: 10px;\r\n  }\r\n  \r\n  .navigation .link.active{\r\n    background-color: #EEEEEE;\r\n    border-radius: 5px;\r\n  }\r\n  \r\n  .items{\r\n    font-weight: 500;\r\n    min-width: 70px;\r\n  }\r\n  \r\n  @media screen and (max-width: 680px) {\r\n    .navigation{\r\n        display: none;\r\n    }\r\n  }"
  },
  {
    "path": "083/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \r\nimport Logo from \"../assets/logo.png\"\r\nimport \"./Header.css\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"Shopmate Logo\" />\r\n        <span>Shopping Cart</span>\r\n      </Link>\r\n      <nav className=\"navigation\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\r\n      </nav>\r\n      <Link to=\"/cart\" className=\"items\">\r\n        <span>Cart: 2</span>\r\n      </Link>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "083/src/components/ProductCard.css",
    "content": ".productCard{\r\n    width: 350px;\r\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n    padding: 10px;\r\n    display: flex;\r\n    flex-direction: column;\r\n    justify-content: space-between;\r\n  }\r\n  \r\n  .productCard img{\r\n    max-width: 100%;\r\n    height: 250px;\r\n    margin: 10px 0px;\r\n  }\r\n  \r\n  .productCard .name{\r\n    margin: 10px 0px;\r\n  }\r\n  \r\n  .productCard p{\r\n    font-size: 18px;\r\n    font-weight: 500;\r\n  }\r\n  \r\n  .productCard .action{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n    margin: 10px 0px;\r\n  }\r\n  \r\n  .productCard button{\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    font-size: 16px;\r\n    color: #FFFFFF;\r\n    background-color: #1C59AE;\r\n    padding: 7px 10px;\r\n    cursor: pointer;\r\n    max-width: 150px;\r\n  }\r\n  \r\n  .productCard button:hover{\r\n    background-color: #103f80;\r\n  }"
  },
  {
    "path": "083/src/components/ProductCard.js",
    "content": "import \"./ProductCard.css\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n  const {name, price, image} = product;\r\n\r\n  return (\r\n    <div className=\"productCard\">\r\n      <img src={image} alt={name} />\r\n      <p className=\"name\">{name}</p>\r\n      <div className=\"action\">\r\n        <p>${price}</p>\r\n        <button>Add To Cart</button>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "083/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\n\r\nexport { ProductCard } from \"./ProductCard\";\r\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "083/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n  useEffect(() => {\r\n    document.title = `${title} | Shopping Cart`\r\n  }, [title]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "083/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "083/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "083/src/pages/Cart.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\r\nimport { CartCard } from \"../components\";\r\n\r\nexport const Cart = () => {\r\n  useTitle(\"Cart\");\r\n  \r\n  const products = [\r\n    {id: 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\",}, \r\n    {id: 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\",}, \r\n  ]\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"cart\">\r\n        <h1>Cart Items: {products.length}</h1>\r\n        { products.map((product) => (\r\n          <CartCard key={product.id} product={product} />\r\n        )) }        \r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "083/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\r\nimport { ProductCard } from \"../components\";\r\n\r\nexport const Home = () => {\r\n  useTitle(\"Home\");\r\n\r\n  const products = [\r\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\r\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\r\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\r\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\r\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\r\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\r\n  ]\r\n\r\n  return (\r\n    <main>\r\n      <section className=\"products\">\r\n        { products.map((product) => (\r\n          <ProductCard key={product.id} product={product} />\r\n        )) }        \r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "083/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\r\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "083/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { Home, Cart } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n      <Routes>\r\n        <Route path=\"/\" element={<Home />} />\r\n        <Route path=\"/cart\" element={<Cart />} />\r\n      </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "086/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "086/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "086/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "086/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "086/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "086/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "086/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "086/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "086/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "086/src/components/CartCard.js",
    "content": "import \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "086/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "086/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>Shopping Cart</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: 2</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "086/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n\n.productCard .remove{\n    background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n    background-color: #8e090f;\n}"
  },
  {
    "path": "086/src/components/ProductCard.js",
    "content": "import \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        <button>Add To Cart</button>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "086/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "086/src/context/CartContext.js",
    "content": ""
  },
  {
    "path": "086/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "086/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "086/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "086/src/pages/Cart.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  useTitle(\"Cart\");\n  \n  const products = [\n    {id: 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\",}, \n    {id: 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\",}, \n  ]\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {products.length}</h1>\n        { products.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "086/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "086/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "086/src/reducer/cartReducer.js",
    "content": ""
  },
  {
    "path": "086/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "087/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "087/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "087/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "087/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "087/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "087/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "087/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "087/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "087/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "087/src/components/CartCard.js",
    "content": "import \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "087/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "087/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>Shopping Cart</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: 2</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "087/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n\n.productCard .remove{\n    background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n    background-color: #8e090f;\n}"
  },
  {
    "path": "087/src/components/ProductCard.js",
    "content": "import \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        <button>Add To Cart</button>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "087/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "087/src/context/CartContext.js",
    "content": "import { useContext } from \"react\";\r\nimport { createContext } from \"react\";\r\n\r\nconst initialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(initialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n\r\n    const value = {\r\n        total: 50,\r\n    };\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    );\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "087/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "087/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "087/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { CartProvider } from \"./context/CartContext\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <App />\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "087/src/pages/Cart.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  const { total } = useCart();\n  useTitle(\"Cart\");\n  \n  const products = [\n    {id: 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\",}, \n    {id: 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\",}, \n  ]\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {products.length} / ${total}</h1>\n        { products.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "087/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "087/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "087/src/reducer/cartReducer.js",
    "content": ""
  },
  {
    "path": "087/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "088/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "088/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "088/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "088/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "088/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "088/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "088/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "088/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "088/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "088/src/components/CartCard.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const { removeFromCart } = useCart();\n\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button onClick={() => removeFromCart(product)}>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "088/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "088/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>Shopping Cart</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: 2</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "088/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n\n.productCard .remove{\n    background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n    background-color: #8e090f;\n}"
  },
  {
    "path": "088/src/components/ProductCard.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const { addToCart } = useCart();\n  const {name, price, image} = product;\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        <button onClick={() => addToCart(product)}>Add To Cart</button>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "088/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "088/src/context/CartContext.js",
    "content": "import { useContext, useReducer } from \"react\";\r\nimport { createContext } from \"react\";\r\nimport { cartReducer } from \"../reducer/cartReducer\";\r\n\r\nconst initialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(initialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, initialState);\r\n\r\n    const addToCart = (product) => {\r\n        const updatedCartList = state.cartList.concat(product);\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedCartList\r\n            }\r\n        })\r\n    }\r\n\r\n    const removeFromCart = (product) => {\r\n        const updatedCartList = state.cartList.filter(current => current.id !== product.id);\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedCartList\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        total: state.total,\r\n        cartList: state.cartList,\r\n        addToCart,\r\n        removeFromCart\r\n    };\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    );\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "088/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "088/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "088/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { CartProvider } from \"./context/CartContext\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <App />\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "088/src/pages/Cart.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  const { total } = useCart();\n  useTitle(\"Cart\");\n  \n  const products = [\n    {id: 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\",}, \n    {id: 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\",}, \n  ]\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {products.length} / ${total}</h1>\n        { products.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "088/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "088/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "088/src/reducer/cartReducer.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products}\r\n        \r\n        default:\r\n            throw new Error(\"No Case Found In cartReducer\")\r\n    }\r\n}"
  },
  {
    "path": "088/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "089/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "089/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "089/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "089/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "089/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "089/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "089/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "089/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "089/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "089/src/components/CartCard.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const { removeFromCart } = useCart();\n\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button onClick={() => removeFromCart(product)}>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "089/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "089/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport { useCart } from \"../context/CartContext\";\nimport \"./Header.css\";\n\nexport const Header = () => {\n  const { cartList } = useCart();\n\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>Shopping Cart</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: {cartList.length}</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "089/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n\n.productCard .remove{\n    background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n    background-color: #8e090f;\n}"
  },
  {
    "path": "089/src/components/ProductCard.js",
    "content": "import { useState } from \"react\";\nimport { useEffect } from \"react\";\nimport { useCart } from \"../context/CartContext\";\nimport \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const { cartList, addToCart, removeFromCart } = useCart();\n  const [isInCart, setIsInCart] = useState(false);\n\n  const {id, name, price, image} = product;\n\n  useEffect(() => {\n    const productIsInCart = cartList.find(cartItem => cartItem.id === id);\n\n    if(productIsInCart){\n      setIsInCart(true);\n    } else {\n      setIsInCart(false);\n    }\n\n  }, [cartList, id]);\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        { isInCart ? (<button className=\"remove\" onClick={() => removeFromCart(product)}>Remove</button>) :  (<button onClick={() => addToCart(product)}>Add To Cart</button>) }\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "089/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "089/src/context/CartContext.js",
    "content": "import { useContext, useReducer } from \"react\";\r\nimport { createContext } from \"react\";\r\nimport { cartReducer } from \"../reducer/cartReducer\";\r\n\r\nconst initialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(initialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, initialState);\r\n\r\n    const addToCart = (product) => {\r\n        const updatedCartList = state.cartList.concat(product);\r\n        updateTotal(updatedCartList);\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedCartList\r\n            }\r\n        })\r\n    }\r\n\r\n    const removeFromCart = (product) => {\r\n        const updatedCartList = state.cartList.filter(current => current.id !== product.id);\r\n        updateTotal(updatedCartList);\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedCartList\r\n            }\r\n        })\r\n    }\r\n\r\n    const updateTotal = (products) => {\r\n        let total = 0;\r\n        products.forEach(product => total = total + product.price);\r\n\r\n        dispatch({\r\n            type: \"UPDATE_TOTAL\",\r\n            payload: {\r\n                total\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        total: state.total,\r\n        cartList: state.cartList,\r\n        addToCart,\r\n        removeFromCart\r\n    };\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    );\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "089/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "089/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "089/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { CartProvider } from \"./context/CartContext\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <App />\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "089/src/pages/Cart.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  const { total, cartList } = useCart();\n  useTitle(\"Cart\");\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {cartList.length} / ${total}</h1>\n        { cartList.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "089/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "089/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "089/src/reducer/cartReducer.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products}\r\n\r\n        case \"UPDATE_TOTAL\":\r\n            return {...state, total: payload.total}\r\n        \r\n        default:\r\n            throw new Error(\"No Case Found In cartReducer\")\r\n    }\r\n}"
  },
  {
    "path": "089/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "090/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "090/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "090/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "090/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "090/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "090/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "090/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "090/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "090/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "090/src/components/CartCard.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const { removeFromCart } = useCart();\n\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button onClick={() => removeFromCart(product)}>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "090/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "090/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport { useCart } from \"../context/CartContext\";\nimport \"./Header.css\";\n\nexport const Header = () => {\n  const { cartList } = useCart();\n\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>Shopping Cart</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: {cartList.length}</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "090/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n\n.productCard .remove{\n    background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n    background-color: #8e090f;\n}"
  },
  {
    "path": "090/src/components/ProductCard.js",
    "content": "import { useState } from \"react\";\nimport { useEffect } from \"react\";\nimport { useCart } from \"../context/CartContext\";\nimport \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const { cartList, addToCart, removeFromCart } = useCart();\n  const [isInCart, setIsInCart] = useState(false);\n\n  const {id, name, price, image} = product;\n\n  useEffect(() => {\n    const productIsInCart = cartList.find(cartItem => cartItem.id === id);\n\n    if(productIsInCart){\n      setIsInCart(true);\n    } else {\n      setIsInCart(false);\n    }\n\n  }, [cartList, id]);\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        { isInCart ? (<button className=\"remove\" onClick={() => removeFromCart(product)}>Remove</button>) :  (<button onClick={() => addToCart(product)}>Add To Cart</button>) }\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "090/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "090/src/context/CartContext.js",
    "content": "import { useContext, useReducer } from \"react\";\r\nimport { createContext } from \"react\";\r\nimport { cartReducer } from \"../reducer/cartReducer\";\r\n\r\nconst initialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(initialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, initialState);\r\n\r\n    const addToCart = (product) => {\r\n        const updatedCartList = state.cartList.concat(product);\r\n        updateTotal(updatedCartList);\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedCartList\r\n            }\r\n        })\r\n    }\r\n\r\n    const removeFromCart = (product) => {\r\n        const updatedCartList = state.cartList.filter(current => current.id !== product.id);\r\n        updateTotal(updatedCartList);\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedCartList\r\n            }\r\n        })\r\n    }\r\n\r\n    const updateTotal = (products) => {\r\n        let total = 0;\r\n        products.forEach(product => total = total + product.price);\r\n\r\n        dispatch({\r\n            type: \"UPDATE_TOTAL\",\r\n            payload: {\r\n                total\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        total: state.total,\r\n        cartList: state.cartList,\r\n        addToCart,\r\n        removeFromCart\r\n    };\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    );\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "090/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "090/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "090/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { CartProvider } from \"./context/CartContext\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <App />\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "090/src/pages/Cart.js",
    "content": "import { useCart } from \"../context/CartContext\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  const { total, cartList } = useCart();\n  useTitle(\"Cart\");\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {cartList.length} / ${total}</h1>\n        { cartList.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "090/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "090/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "090/src/reducer/cartReducer.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products}\r\n\r\n        case \"UPDATE_TOTAL\":\r\n            return {...state, total: payload.total}\r\n        \r\n        default:\r\n            throw new Error(\"No Case Found In cartReducer\")\r\n    }\r\n}"
  },
  {
    "path": "090/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "091/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "091/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "091/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@reduxjs/toolkit\": \"^1.8.5\",\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-redux\": \"^8.0.2\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "091/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "091/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "091/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "091/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "091/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "091/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "091/src/components/CartCard.js",
    "content": "import \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "091/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "091/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>REDUX CART</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: 2</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "091/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }"
  },
  {
    "path": "091/src/components/ProductCard.js",
    "content": "import \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        <button>Add To Cart</button>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "091/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "091/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "091/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "091/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "091/src/pages/Cart.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  useTitle(\"Cart\");\n  \n  const products = [\n    {id: 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\",}, \n    {id: 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\",}, \n  ]\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {products.length}</h1>\n        { products.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "091/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "091/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "091/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "091/src/store/cartSlice.js",
    "content": ""
  },
  {
    "path": "091/src/store/store.js",
    "content": ""
  },
  {
    "path": "092/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "092/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "092/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@reduxjs/toolkit\": \"^1.8.5\",\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-redux\": \"^8.0.2\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "092/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "092/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "092/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "092/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "092/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "092/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "092/src/components/CartCard.js",
    "content": "import \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "092/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "092/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>REDUX CART</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: 2</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "092/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }"
  },
  {
    "path": "092/src/components/ProductCard.js",
    "content": "import \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const {name, price, image} = product;\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        <button>Add To Cart</button>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "092/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "092/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "092/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "092/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { Provider } from \"react-redux\";\nimport { store } from \"./store/store\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Provider store={store}>\n      <Router>\n        <App />\n      </Router>\n    </Provider>    \n  </React.StrictMode>\n);"
  },
  {
    "path": "092/src/pages/Cart.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  useTitle(\"Cart\");\n  \n  const products = [\n    {id: 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\",}, \n    {id: 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\",}, \n  ]\n\n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {products.length}</h1>\n        { products.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "092/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "092/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "092/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "092/src/store/cartSlice.js",
    "content": "const { createSlice } = require(\"@reduxjs/toolkit\");\r\n\r\nconst cartSlice = createSlice({\r\n    name: \"cart\",\r\n    initialState: {\r\n        cartList: [],\r\n        total: 0\r\n    },\r\n    reducers: {\r\n        add(state, action){\r\n            console.log(action.payload);\r\n        },\r\n        remove(){\r\n\r\n        }\r\n    }\r\n});\r\n\r\nexport const { add, remove } = cartSlice.actions;\r\nexport const cartReducer = cartSlice.reducer;"
  },
  {
    "path": "092/src/store/store.js",
    "content": "import { configureStore } from \"@reduxjs/toolkit\";\r\nimport { cartReducer } from \"./cartSlice\";\r\n\r\nexport const store = configureStore({\r\n    reducer: {\r\n        cartState: cartReducer,\r\n    }\r\n});"
  },
  {
    "path": "093/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "093/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "093/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@reduxjs/toolkit\": \"^1.8.5\",\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-redux\": \"^8.0.2\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "093/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "093/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "093/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "093/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "093/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "093/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "093/src/components/CartCard.js",
    "content": "import { useDispatch } from \"react-redux\";\nimport { remove } from \"../store/cartSlice\";\nimport \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const dispatch = useDispatch();\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button onClick={() => dispatch(remove(product))}>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "093/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "093/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>REDUX CART</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: 2</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "093/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }"
  },
  {
    "path": "093/src/components/ProductCard.js",
    "content": "import { useDispatch } from \"react-redux\";\nimport { add, remove } from \"../store/cartSlice\";\nimport \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const dispatch = useDispatch();\n  const {name, price, image} = product;\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        <button onClick={() => dispatch(add(product))}>Add To Cart</button>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "093/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "093/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "093/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "093/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { Provider } from \"react-redux\";\nimport { store } from \"./store/store\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Provider store={store}>\n      <Router>\n        <App />\n      </Router>\n    </Provider>    \n  </React.StrictMode>\n);"
  },
  {
    "path": "093/src/pages/Cart.js",
    "content": "import { useSelector } from \"react-redux\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  useTitle(\"Cart\");\n  const products = useSelector(state => state.cartState.cartList);\n  const total = useSelector(state => state.cartState.total);\n  \n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {products.length} / ${total}</h1>\n        { products.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "093/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "093/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "093/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "093/src/store/cartSlice.js",
    "content": "const { createSlice } = require(\"@reduxjs/toolkit\");\r\n\r\nconst cartSlice = createSlice({\r\n    name: \"cart\",\r\n    initialState: {\r\n        cartList: [],\r\n        total: 0\r\n    },\r\n    reducers: {\r\n        add(state, action){\r\n            const updatedCartList = state.cartList.concat(action.payload);\r\n            const total = state.total + action.payload.price;\r\n            return {...state, total: total, cartList: updatedCartList};\r\n        },\r\n        remove(state, action){\r\n            const updatedCartList = state.cartList.filter(item => item.id !== action.payload.id);\r\n            const total = state.total - action.payload.price;\r\n            return {...state, total: total, cartList: updatedCartList};\r\n        }\r\n    }\r\n});\r\n\r\nexport const { add, remove } = cartSlice.actions;\r\nexport const cartReducer = cartSlice.reducer;"
  },
  {
    "path": "093/src/store/store.js",
    "content": "import { configureStore } from \"@reduxjs/toolkit\";\r\nimport { cartReducer } from \"./cartSlice\";\r\n\r\nexport const store = configureStore({\r\n    reducer: {\r\n        cartState: cartReducer,\r\n    }\r\n});"
  },
  {
    "path": "094/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "094/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "094/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@reduxjs/toolkit\": \"^1.8.5\",\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-redux\": \"^8.0.2\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "094/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "094/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "094/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "094/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "094/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "094/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "094/src/components/CartCard.js",
    "content": "import { useDispatch } from \"react-redux\";\nimport { remove } from \"../store/cartSlice\";\nimport \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const dispatch = useDispatch();\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button onClick={() => dispatch(remove(product))}>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "094/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "094/src/components/Header.js",
    "content": "import { useSelector } from \"react-redux\";\nimport { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  const cartList = useSelector(state => state.cartState.cartList);\n\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>REDUX CART</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: {cartList.length}</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "094/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n  \n.productCard .remove{\n  background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n  background-color: #8e090f;\n}"
  },
  {
    "path": "094/src/components/ProductCard.js",
    "content": "import { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { add, remove } from \"../store/cartSlice\";\nimport \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const dispatch = useDispatch();\n  const cartList = useSelector(state => state.cartState.cartList);\n  const [isInCart, setIsInCart] = useState(false);\n\n  const {id, name, price, image} = product;\n\n  useEffect(() => {\n    const productInCart = cartList.find(item => item.id === id);\n\n    if(productInCart){\n      setIsInCart(true);\n    } else {\n      setIsInCart(false);\n    }\n\n  }, [cartList, id]);\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        { isInCart ? (<button className=\"remove\" onClick={() => dispatch(remove(product))}>Remove</button>) : (<button onClick={() => dispatch(add(product))}>Add To Cart</button>) }\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "094/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "094/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "094/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "094/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { Provider } from \"react-redux\";\nimport { store } from \"./store/store\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Provider store={store}>\n      <Router>\n        <App />\n      </Router>\n    </Provider>    \n  </React.StrictMode>\n);"
  },
  {
    "path": "094/src/pages/Cart.js",
    "content": "import { useSelector } from \"react-redux\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  useTitle(\"Cart\");\n  const cartList = useSelector(state => state.cartState.cartList);\n  const total = useSelector(state => state.cartState.total);\n  \n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {cartList.length} / ${total}</h1>\n        { cartList.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "094/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "094/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "094/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "094/src/store/cartSlice.js",
    "content": "const { createSlice } = require(\"@reduxjs/toolkit\");\r\n\r\nconst cartSlice = createSlice({\r\n    name: \"cart\",\r\n    initialState: {\r\n        cartList: [],\r\n        total: 0\r\n    },\r\n    reducers: {\r\n        add(state, action){\r\n            const updatedCartList = state.cartList.concat(action.payload);\r\n            const total = state.total + action.payload.price;\r\n            return {...state, total: total, cartList: updatedCartList};\r\n        },\r\n        remove(state, action){\r\n            const updatedCartList = state.cartList.filter(item => item.id !== action.payload.id);\r\n            const total = state.total - action.payload.price;\r\n            return {...state, total: total, cartList: updatedCartList};\r\n        }\r\n    }\r\n});\r\n\r\nexport const { add, remove } = cartSlice.actions;\r\nexport const cartReducer = cartSlice.reducer;"
  },
  {
    "path": "094/src/store/store.js",
    "content": "import { configureStore } from \"@reduxjs/toolkit\";\r\nimport { cartReducer } from \"./cartSlice\";\r\n\r\nexport const store = configureStore({\r\n    reducer: {\r\n        cartState: cartReducer,\r\n    }\r\n});"
  },
  {
    "path": "095/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "095/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "095/package.json",
    "content": "{\n  \"name\": \"shopmate\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@reduxjs/toolkit\": \"^1.8.5\",\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-redux\": \"^8.0.2\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "095/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "095/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "095/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "095/src/App.css",
    "content": ".products{\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n  margin: 30px 0px;\n}\n\n.cart{\n  margin: 30px 0px;\n}\n\n.cart h1{\n  text-align: center;\n}"
  },
  {
    "path": "095/src/App.js",
    "content": "import { AllRoutes } from \"./routes/AllRoutes\";\nimport { Header } from \"./components\";\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "095/src/components/CartCard.css",
    "content": ".cartCard{\n    display: flex;    \n    justify-content: space-between;\n    align-items: center;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 30px 10px;\n    padding: 10px;\n  }\n  \n  .cartCard img{\n    width: 150px;\n    height: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productName{\n    width: 350px;\n    margin-right: 10px;\n  }\n  \n  .cartCard .productPrice{\n    width: 100px;\n    margin-right: 10px;\n  }\n  \n  .cartCard button{\n    border: 0px;\n    background-color: #ac0d14;\n    color: #FFFFFF;\n    border-radius: 5px;\n    padding: 5px 10px;\n    cursor: pointer;\n  }\n  \n  .cartCard button:hover{\n    background-color: #8e090f;\n  }\n  \n  \n  @media screen and (max-width: 680px) {\n    .cartCard img{\n        display: none;\n    }\n  }"
  },
  {
    "path": "095/src/components/CartCard.js",
    "content": "import { useDispatch } from \"react-redux\";\nimport { remove } from \"../store/cartSlice\";\nimport \"./CartCard.css\";\n\nexport const CartCard = ({product}) => {\n  const dispatch = useDispatch();\n  const {name, price, image} = product;\n\n  return (\n      <div className=\"cartCard\">\n        <img src={image} alt={name} />\n        <p className=\"productName\">{name}</p>\n        <p className=\"productPrice\">${price}</p>\n        <button onClick={() => dispatch(remove(product))}>Remove</button>\n      </div>\n  )\n}\n"
  },
  {
    "path": "095/src/components/Header.css",
    "content": "header {\n    display: flex;\n    justify-content: space-between;\n    height: 70px;\n    align-items: center;\n    max-width: 1200px;\n    margin: auto;\n    border-bottom: 1px solid #EEEEEE;\n    font-size: 18px;\n    padding: 0px 10px;\n  }\n  \n  .logo{\n    display: flex;\n    align-items: center;\n  }\n  .logo img{\n    max-width: 40px;\n    margin-right: 5px;\n  }\n  \n  .navigation .link{\n    padding: 10px;\n  }\n  \n  .navigation .link.active{\n    background-color: #EEEEEE;\n    border-radius: 5px;\n  }\n  \n  .items{\n    font-weight: 500;\n    min-width: 70px;\n  }\n  \n  @media screen and (max-width: 680px) {\n    .navigation{\n        display: none;\n    }\n  }"
  },
  {
    "path": "095/src/components/Header.js",
    "content": "import { useSelector } from \"react-redux\";\nimport { Link, NavLink } from \"react-router-dom\"; \nimport Logo from \"../assets/logo.png\"\nimport \"./Header.css\";\n\nexport const Header = () => {\n  const cartList = useSelector(state => state.cartState.cartList);\n\n  return (\n    <header>\n      <Link to=\"/\" className=\"logo\">\n        <img src={Logo} alt=\"Shopmate Logo\" />\n        <span>REDUX CART</span>\n      </Link>\n      <nav className=\"navigation\">\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\n        <NavLink to=\"/cart\" className=\"link\">Cart</NavLink>\n      </nav>\n      <Link to=\"/cart\" className=\"items\">\n        <span>Cart: {cartList.length}</span>\n      </Link>\n    </header>\n  )\n}\n"
  },
  {
    "path": "095/src/components/ProductCard.css",
    "content": ".productCard{\n    width: 350px;\n    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n    border-radius: 5px;\n    margin: 10px;\n    padding: 10px;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  \n  .productCard img{\n    max-width: 100%;\n    height: 250px;\n    margin: 10px 0px;\n  }\n  \n  .productCard .name{\n    margin: 10px 0px;\n  }\n  \n  .productCard p{\n    font-size: 18px;\n    font-weight: 500;\n  }\n  \n  .productCard .action{\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin: 10px 0px;\n  }\n  \n  .productCard button{\n    border: 0px;\n    border-radius: 5px;\n    font-size: 16px;\n    color: #FFFFFF;\n    background-color: #1C59AE;\n    padding: 7px 10px;\n    cursor: pointer;\n    max-width: 150px;\n  }\n  \n  .productCard button:hover{\n    background-color: #103f80;\n  }\n  \n.productCard .remove{\n  background-color: #ac0d14;\n}\n\n.productCard .remove:hover{\n  background-color: #8e090f;\n}"
  },
  {
    "path": "095/src/components/ProductCard.js",
    "content": "import { useEffect, useState } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { add, remove } from \"../store/cartSlice\";\nimport \"./ProductCard.css\";\n\nexport const ProductCard = ({product}) => {\n  const dispatch = useDispatch();\n  const cartList = useSelector(state => state.cartState.cartList);\n  const [isInCart, setIsInCart] = useState(false);\n\n  const {id, name, price, image} = product;\n\n  useEffect(() => {\n    const productInCart = cartList.find(item => item.id === id);\n\n    if(productInCart){\n      setIsInCart(true);\n    } else {\n      setIsInCart(false);\n    }\n\n  }, [cartList, id]);\n\n  return (\n    <div className=\"productCard\">\n      <img src={image} alt={name} />\n      <p className=\"name\">{name}</p>\n      <div className=\"action\">\n        <p>${price}</p>\n        { isInCart ? (<button className=\"remove\" onClick={() => dispatch(remove(product))}>Remove</button>) : (<button onClick={() => dispatch(add(product))}>Add To Cart</button>) }\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "095/src/components/index.js",
    "content": "export { Header } from \"./Header\";\n\nexport { ProductCard } from \"./ProductCard\";\nexport { CartCard } from \"./CartCard\";"
  },
  {
    "path": "095/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\n\nexport const useTitle = (title) => {\n\n  useEffect(() => {\n    document.title = `${title} | Shopping Cart`\n  }, [title]);\n\n  return null;\n}\n"
  },
  {
    "path": "095/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n\n* {\n  margin: 0;\n  padding: 0;\n  font-family: 'Poppins', sans-serif;\n  text-decoration: none;\n  list-style: none;\n}\n\nmain {\n    min-height: 100vh;\n    max-width: 1280px;\n    margin: auto;\n    padding: 10px;\n}\n\na{\n  text-decoration: none;\n  color: #000000;\n}"
  },
  {
    "path": "095/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport { Provider } from \"react-redux\";\nimport { store } from \"./store/store\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Provider store={store}>\n      <Router>\n        <App />\n      </Router>\n    </Provider>    \n  </React.StrictMode>\n);"
  },
  {
    "path": "095/src/pages/Cart.js",
    "content": "import { useSelector } from \"react-redux\";\nimport { useTitle } from \"../hooks/useTitle\";\nimport { CartCard } from \"../components\";\n\nexport const Cart = () => {\n  useTitle(\"Cart\");\n  const cartList = useSelector(state => state.cartState.cartList);\n  const total = useSelector(state => state.cartState.total);\n  \n  return (\n    <main>\n      <section className=\"cart\">\n        <h1>Cart Items: {cartList.length} / ${total}</h1>\n        { cartList.map((product) => (\n          <CartCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "095/src/pages/Home.js",
    "content": "import { useTitle } from \"../hooks/useTitle\";\nimport { ProductCard } from \"../components\";\n\nexport const Home = () => {\n  useTitle(\"Home\");\n\n  const products = [\n    {\"id\": 1, \"name\": \"Sony Wh-Ch510 Bluetooth Wireless\", \"price\": 149, \"image\": \"/assets/images/1001.png\"},\n    {\"id\": 2, \"name\": \"boAt Rockerz 450\", \"price\": 49, \"image\": \"/assets/images/1002.png\"},\n    {\"id\": 3, \"name\": \"JBL Tune 760NC\", \"price\": 179, \"image\": \"/assets/images/1003.png\"},\n    {\"id\": 4, \"name\": \"Logitech H111 Wired\", \"price\": 39, \"image\": \"/assets/images/1004.png\"},\n    {\"id\": 5, \"name\": \"APPLE Airpods Max Bluetooth Headset\", \"price\": 199, \"image\": \"/assets/images/1005.png\"},\n    {\"id\": 6, \"name\": \"ZEBRONICS Zeb-Thunder Wired\", \"price\": 29, \"image\": \"/assets/images/1006.png\"}\n  ]\n\n  return (\n    <main>\n      <section className=\"products\">\n        { products.map((product) => (\n          <ProductCard key={product.id} product={product} />\n        )) }        \n      </section>\n    </main>\n  )\n}\n"
  },
  {
    "path": "095/src/pages/index.js",
    "content": "export { Home } from \"./Home\";\nexport { Cart } from \"./Cart\";"
  },
  {
    "path": "095/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\nimport { Home, Cart } from \"../pages\";\n\nexport const AllRoutes = () => {\n  return (\n    <>\n      <Routes>\n        <Route path=\"/\" element={<Home />} />\n        <Route path=\"/cart\" element={<Cart />} />\n      </Routes>\n    </>\n  )\n}\n"
  },
  {
    "path": "095/src/store/cartSlice.js",
    "content": "const { createSlice } = require(\"@reduxjs/toolkit\");\r\n\r\nconst cartSlice = createSlice({\r\n    name: \"cart\",\r\n    initialState: {\r\n        cartList: [],\r\n        total: 0\r\n    },\r\n    reducers: {\r\n        add(state, action){\r\n            const updatedCartList = state.cartList.concat(action.payload);\r\n            const total = state.total + action.payload.price;\r\n            return {...state, total: total, cartList: updatedCartList};\r\n        },\r\n        remove(state, action){\r\n            const updatedCartList = state.cartList.filter(item => item.id !== action.payload.id);\r\n            const total = state.total - action.payload.price;\r\n            return {...state, total: total, cartList: updatedCartList};\r\n        }\r\n    }\r\n});\r\n\r\nexport const { add, remove } = cartSlice.actions;\r\nexport const cartReducer = cartSlice.reducer;"
  },
  {
    "path": "095/src/store/store.js",
    "content": "import { configureStore } from \"@reduxjs/toolkit\";\r\nimport { cartReducer } from \"./cartSlice\";\r\n\r\nexport const store = configureStore({\r\n    reducer: {\r\n        cartState: cartReducer,\r\n    }\r\n});"
  },
  {
    "path": "097/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "097/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "097/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "097/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "097/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "097/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "097/src/App.css",
    "content": ""
  },
  {
    "path": "097/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Hello World</h1>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "097/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}"
  },
  {
    "path": "097/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "097/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "098/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "098/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "098/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "098/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "098/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "098/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "098/src/App.css",
    "content": ""
  },
  {
    "path": "098/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Hello World</h1>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "098/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}"
  },
  {
    "path": "098/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "098/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "099/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "099/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "099/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "099/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "099/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "099/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "099/src/App.css",
    "content": ""
  },
  {
    "path": "099/src/App.js",
    "content": "import './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <h1>Hello World</h1>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "099/src/components/Elements/ProductCard.js",
    "content": ""
  },
  {
    "path": "099/src/components/Layouts/Footer.js",
    "content": ""
  },
  {
    "path": "099/src/components/Layouts/Header.js",
    "content": ""
  },
  {
    "path": "099/src/components/Other/ScrollToTop.js",
    "content": ""
  },
  {
    "path": "099/src/components/Sections/Search.js",
    "content": ""
  },
  {
    "path": "099/src/components/index.js",
    "content": ""
  },
  {
    "path": "099/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}"
  },
  {
    "path": "099/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);"
  },
  {
    "path": "099/src/pages/Cart/CartPage.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Cart/components/CartCard.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Cart/components/CartEmpty.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Cart/components/CartList.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Cart/components/Checkout.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Dashboard/DashbaordPage.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Dashboard/components/DashbaordCard.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Home/HomePage.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Home/components/Faq.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Home/components/FeaturedProducts.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Home/components/Hero.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Home/components/Testimonials.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Login.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Order/OrderPage.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Order/components/OrderFail.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Order/components/OrderSuccess.js",
    "content": ""
  },
  {
    "path": "099/src/pages/PageNotFound.js",
    "content": ""
  },
  {
    "path": "099/src/pages/ProductDetail.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Products/ProductsList.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Products/components/FilterBar.js",
    "content": ""
  },
  {
    "path": "099/src/pages/Register.js",
    "content": ""
  },
  {
    "path": "099/src/pages/index.js",
    "content": ""
  },
  {
    "path": "099/src/routes/AllRoutes.js",
    "content": ""
  },
  {
    "path": "099/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "100/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "100/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "100/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "100/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "100/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "100/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "100/src/App.css",
    "content": ""
  },
  {
    "path": "100/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "100/src/components/Elements/ProductCard.js",
    "content": ""
  },
  {
    "path": "100/src/components/Layouts/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <div>Footer</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100/src/components/Layouts/Header.js",
    "content": "import React from 'react'\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <div>Header</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100/src/components/Other/ScrollToTop.js",
    "content": ""
  },
  {
    "path": "100/src/components/Sections/Search.js",
    "content": ""
  },
  {
    "path": "100/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";"
  },
  {
    "path": "100/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}"
  },
  {
    "path": "100/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "100/src/pages/Cart/CartPage.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Cart/components/CartCard.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Cart/components/CartEmpty.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Cart/components/CartList.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Cart/components/Checkout.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Dashboard/DashbaordPage.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Dashboard/components/DashbaordCard.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Home/HomePage.js",
    "content": "export const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <div>Home</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100/src/pages/Home/components/Faq.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Home/components/FeaturedProducts.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Home/components/Hero.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Home/components/Testimonials.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Login.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Order/OrderPage.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Order/components/OrderFail.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Order/components/OrderSuccess.js",
    "content": ""
  },
  {
    "path": "100/src/pages/PageNotFound.js",
    "content": ""
  },
  {
    "path": "100/src/pages/ProductDetail.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Products/ProductsList.js",
    "content": "export const ProductsList = () => {\r\n  return (\r\n    <div>ProductsList</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100/src/pages/Products/components/FilterBar.js",
    "content": ""
  },
  {
    "path": "100/src/pages/Register.js",
    "content": ""
  },
  {
    "path": "100/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";"
  },
  {
    "path": "100/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "100-base-components-pages/README.md",
    "content": "Note: \r\n- The repository only contain HTML and Tailwind code.\r\n- Each of them are structured in functional component and saved as .js to avoid confusion."
  },
  {
    "path": "100-base-components-pages/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/components/Elements/ProductCard.js",
    "content": "export const ProductCard = () => {\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <a href=\"/\" className=\"relative\" >\r\n            <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span>\r\n            <img className=\"rounded-t-lg w-full h-64\" src=\"\" alt=\"\" />\r\n        </a>\r\n        <div className=\"p-5\">\r\n            <a href=\"/\">\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">The Complete Guide to Backend Development</h5>\r\n            </a>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>29</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/components/Layouts/Header.js",
    "content": "export const Header = () => {\r\n  return (\r\n    <header>      \r\n        <nav class=\"bg-white dark:bg-gray-900\">\r\n            <div class=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n                <a href=\"/\" class=\"flex items-center\">\r\n                    <img src=\"Logo\" class=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                    <span class=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n                </a>\r\n                <div class=\"flex items-center relative\">\r\n                    <span class=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                    <span class=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                    <a href=\"/cart\" class=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span class=\"text-2xl bi bi-cart-fill relative\">\r\n                        <span class=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                    </a>\r\n                    <span class=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                </div>\r\n            </div>\r\n        </nav>\r\n    </header>\r\n  )\r\n}"
  },
  {
    "path": "100-base-components-pages/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "100-base-components-pages/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Home/HomePage.js",
    "content": "export const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <div>Home</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Home/components/Faq.js",
    "content": "export const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              <div>\r\n                  <h2 id=\"accordion-flush-heading-1\">\r\n                      <button type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                        <span className=\"text-xl text-slate-900 dark:text-white\">question</span>\r\n                        <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                        {/* <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> */}\r\n                      </button>\r\n                  </h2>                   \r\n                  <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                      <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                          <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">answer</p>\r\n                      </div>\r\n                  </div>                   \r\n              </div>             \r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Home/components/FeaturedProducts.js",
    "content": "export const FeaturedProducts = () => {\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            {/* Product Card */}\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Home/components/Hero.js",
    "content": "export const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <a href=\"\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</a>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">The Complete Guide to Backend Development</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src=\"\" alt=\"\" />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">29</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span>   \r\n                <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span>\r\n                {/* <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> */}\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">5 MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Products/ProductsList.js",
    "content": "export const ProductsList = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks (15)</span>\r\n            <span>\r\n              <button id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            {/* Product Card */}\r\n          </div>  \r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = () => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "100-base-components-pages/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "101/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "101/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "101/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "101/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "101/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "101/src/App.css",
    "content": ""
  },
  {
    "path": "101/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "101/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/components/Elements/ProductCard.js",
    "content": "export const ProductCard = () => {\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <a href=\"/\" className=\"relative\" >\r\n            <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span>\r\n            <img className=\"rounded-t-lg w-full h-64\" src=\"\" alt=\"\" />\r\n        </a>\r\n        <div className=\"p-5\">\r\n            <a href=\"/\">\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">The Complete Guide to Backend Development</h5>\r\n            </a>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>29</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/components/Layouts/Header.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "101/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";"
  },
  {
    "path": "101/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "101/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "101/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Home/HomePage.js",
    "content": "export const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <div>Home</div>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Home/components/Faq.js",
    "content": "export const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              <div>\r\n                  <h2 id=\"accordion-flush-heading-1\">\r\n                      <button type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                        <span className=\"text-xl text-slate-900 dark:text-white\">question</span>\r\n                        <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                        {/* <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> */}\r\n                      </button>\r\n                  </h2>                   \r\n                  <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                      <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                          <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">answer</p>\r\n                      </div>\r\n                  </div>                   \r\n              </div>             \r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Home/components/FeaturedProducts.js",
    "content": "export const FeaturedProducts = () => {\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            {/* Product Card */}\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Home/components/Hero.js",
    "content": "export const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <a href=\"\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</a>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">The Complete Guide to Backend Development</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src=\"\" alt=\"\" />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">29</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span>   \r\n                <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span>\r\n                {/* <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> */}\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">5 MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Products/ProductsList.js",
    "content": "export const ProductsList = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks (15)</span>\r\n            <span>\r\n              <button id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            {/* Product Card */}\r\n          </div>  \r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = () => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";"
  },
  {
    "path": "101/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "101/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "102/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "102/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "102/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "102/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "102/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "102/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "102/src/App.css",
    "content": ""
  },
  {
    "path": "102/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "102/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const ProductCard = () => {\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to=\"/\" className=\"relative\" >\r\n            <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span>\r\n            <img className=\"rounded-t-lg w-full h-64\" src=\"/assets/images/10001.avif\" alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to=\"/\">\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">The Complete Guide to Backend Development</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>29</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/components/Layouts/Header.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "102/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";"
  },
  {
    "path": "102/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "102/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "102/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { ProductCard } from \"../../../components/Elements/ProductCard\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            <ProductCard />\r\n            <ProductCard />\r\n            <ProductCard />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">The Complete Guide to Backend Development</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src=\"\" alt=\"\" />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">29</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span>   \r\n                <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span>\r\n                {/* <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> */}\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">5 MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Products/ProductsList.js",
    "content": "export const ProductsList = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks (15)</span>\r\n            <span>\r\n              <button id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            {/* Product Card */}\r\n          </div>  \r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = () => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";"
  },
  {
    "path": "102/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "102/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "103/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "103/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "103/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "103/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "103/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "103/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "103/src/App.css",
    "content": ""
  },
  {
    "path": "103/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "103/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const ProductCard = () => {\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to=\"/\" className=\"relative\" >\r\n            <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span>\r\n            <img className=\"rounded-t-lg w-full h-64\" src=\"/assets/images/10001.avif\" alt=\"\" />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to=\"/\">\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">The Complete Guide to Backend Development</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>29</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/components/Layouts/Header.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "103/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";"
  },
  {
    "path": "103/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "103/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "103/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { ProductCard } from \"../../../components/Elements/ProductCard\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            <ProductCard />\r\n            <ProductCard />\r\n            <ProductCard />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">The Complete Guide to Backend Development</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src=\"\" alt=\"\" />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">29</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span>   \r\n                <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span>\r\n                {/* <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> */}\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">5 MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Products/ProductsList.js",
    "content": "import { useState } from \"react\";\r\nimport { ProductCard } from \"../../components/Elements/ProductCard\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks (15)</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            <ProductCard />\r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";"
  },
  {
    "path": "103/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "103/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "104/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "104/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "104/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "104/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "104/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "104/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "104/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "104/src/App.css",
    "content": ""
  },
  {
    "path": "104/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "104/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/components/Layouts/Header.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "104/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";"
  },
  {
    "path": "104/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "104/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "104/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components/Elements/ProductCard\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">The Complete Guide to Backend Development</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src=\"\" alt=\"\" />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">29</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span>   \r\n                <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span>\r\n                {/* <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> */}\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">5 MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../components/Elements/ProductCard\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";"
  },
  {
    "path": "104/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "104/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "105/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "105/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "105/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "105/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "105/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "105/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "105/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "105/src/App.css",
    "content": ""
  },
  {
    "path": "105/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "105/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Layouts/Header.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "105/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";"
  },
  {
    "path": "105/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "105/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "105/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components/Elements/ProductCard\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/ProductDetail.js",
    "content": "export const ProductDetail = () => {\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">The Complete Guide to Backend Development</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src=\"\" alt=\"\" />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">29</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n                  <i className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span>   \r\n                <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span>\r\n                {/* <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> */}\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">5 MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../components/Elements/ProductCard\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";"
  },
  {
    "path": "105/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "105/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "106/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "106/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "106/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "106/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "106/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "106/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "106/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "106/src/App.css",
    "content": ""
  },
  {
    "path": "106/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "106/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Layouts/Header.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "106/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n"
  },
  {
    "path": "106/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "106/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "106/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "106/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "106/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}"
  },
  {
    "path": "107/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "107/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "107/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "107/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "107/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "107/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "107/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "107/src/App.css",
    "content": ""
  },
  {
    "path": "107/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "107/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Other/ScrollToTop.js",
    "content": "export const ScrollToTop = () => {\r\n  return (\r\n    <div>ScrollToTop</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "107/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n"
  },
  {
    "path": "107/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "107/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "107/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "107/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "107/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "108/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "108/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "108/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "108/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "108/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "108/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "108/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "108/src/App.css",
    "content": ""
  },
  {
    "path": "108/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "108/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "108/src/components/Sections/Search.js",
    "content": "export const Search = () => {\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "108/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "108/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "108/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "108/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "108/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "108/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "109/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "109/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "109/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "109/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "109/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "109/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "109/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "109/src/App.css",
    "content": ""
  },
  {
    "path": "109/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "109/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "109/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "109/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "109/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "109/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "109/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Home/HomePage.js",
    "content": "import { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "109/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "109/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "110/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "110/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "110/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "110/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "110/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "110/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "110/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "110/src/App.css",
    "content": ""
  },
  {
    "path": "110/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "110/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "110/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "110/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "110/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "110/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "110/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <ScrollToTop />\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "110/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "110/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "110/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "111/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "111/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "111/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "111/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "111/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "111/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "111/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "111/src/App.css",
    "content": ""
  },
  {
    "path": "111/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "111/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "111/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "111/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "111/src/context/FilterContext.js",
    "content": "import { createContext, useContext } from \"react\"\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const value = {\r\n        productList: [1, 2, 3]\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "111/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "111/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "111/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "111/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "111/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  // const { productList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const [products, setProducts] = useState([]);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "111/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return \r\n        \r\n        case \"SORT_BY\":\r\n            return \r\n        \r\n        case \"RATINGS\":\r\n            return\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "111/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "111/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "111/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "112/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "112/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "112/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "112/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "112/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "112/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "112/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "112/src/App.css",
    "content": ""
  },
  {
    "path": "112/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "112/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "112/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "112/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "112/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    const value = {\r\n        products: state.productList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "112/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "112/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "112/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "112/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "112/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Products/components/FilterBar.js",
    "content": "export const FilterBar = ({setShow}) => {\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "112/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return \r\n        \r\n        case \"RATINGS\":\r\n            return\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "112/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "112/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "112/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "113/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "113/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "113/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "113/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "113/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "113/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "113/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "113/src/App.css",
    "content": ""
  },
  {
    "path": "113/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "113/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "113/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "113/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "113/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "113/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "113/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "113/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "113/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "113/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "113/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "113/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "113/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "113/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "114/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "114/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "114/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "114/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "114/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "114/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "114/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "114/src/App.css",
    "content": ""
  },
  {
    "path": "114/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "114/src/components/Elements/DropdownLoggedIn.js",
    "content": "export const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</a>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/components/Elements/DropdownLoggedOut.js",
    "content": "export const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</a>\r\n            </li>\r\n            <li>\r\n                <a href=\"/\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "114/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "114/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "114/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "114/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "114/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "114/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "114/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "114/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({ setShow }) => {\r\n  const { state, dispatch } = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n      <div\r\n        id=\"drawer-disable-body-scrolling\"\r\n        className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`}\r\n        tabIndex=\"-1\"\r\n        aria-labelledby=\"drawer-disable-body-scrolling-label\"\r\n        aria-modal=\"true\"\r\n        role=\"dialog\"\r\n      >\r\n        <h5\r\n          id=\"drawer-disable-body-scrolling-label\"\r\n          className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\"\r\n        >\r\n          Filters\r\n        </h5>\r\n        <button\r\n          onClick={() => setShow(false)}\r\n          type=\"button\"\r\n          data-drawer-dismiss=\"drawer-disable-body-scrolling\"\r\n          aria-controls=\"drawer-disable-body-scrolling\"\r\n          className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\"\r\n        >\r\n          <svg\r\n            aria-hidden=\"true\"\r\n            className=\"w-5 h-5\"\r\n            fill=\"currentColor\"\r\n            viewBox=\"0 0 20 20\"\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n          >\r\n            <path\r\n              fillRule=\"evenodd\"\r\n              d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\r\n              clipRule=\"evenodd\"\r\n            ></path>\r\n          </svg>\r\n          <span className=\"sr-only\">Close Filters</span>\r\n        </button>\r\n        <div className=\"border-b pb-3\"></div>\r\n        <div className=\"py-4 overflow-y-auto\">\r\n          <ul className=\"text-slate-700 dark:text-slate-100\">\r\n            <li className=\"mt-1 mb-5\">\r\n              <p className=\"font-semibold my-1\">Sort by</p>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"SORT_BY\",\r\n                      payload: { sortBy: \"lowtohigh\" },\r\n                    })\r\n                  }\r\n                  checked={state.sortBy === \"lowtohigh\" || false}\r\n                  id=\"price-sort-1\"\r\n                  type=\"radio\"\r\n                  value=\"\"\r\n                  name=\"price-sort\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"price-sort-1\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  Price - Low to High\r\n                </label>\r\n              </div>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"SORT_BY\",\r\n                      payload: { sortBy: \"hightolow\" },\r\n                    })\r\n                  }\r\n                  checked={state.sortBy === \"hightolow\" || false}\r\n                  id=\"price-sort-2\"\r\n                  type=\"radio\"\r\n                  value=\"\"\r\n                  name=\"price-sort\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"price-sort-2\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  Price - High to Low\r\n                </label>\r\n              </div>\r\n            </li>\r\n            <li className=\"mt-1 mb-5\">\r\n              <span className=\"font-semibold\">Rating</span>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"RATINGS\",\r\n                      payload: { ratings: \"4STARSABOVE\" },\r\n                    })\r\n                  }\r\n                  checked={state.ratings === \"4STARSABOVE\" || false}\r\n                  id=\"rating-sort-1\"\r\n                  type=\"radio\"\r\n                  value=\"\"\r\n                  name=\"rating-sort\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"rating-sort-1\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  4 Stars & Above\r\n                </label>\r\n              </div>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"RATINGS\",\r\n                      payload: { ratings: \"3STARSABOVE\" },\r\n                    })\r\n                  }\r\n                  checked={state.ratings === \"3STARSABOVE\" || false}\r\n                  id=\"rating-sort-2\"\r\n                  type=\"radio\"\r\n                  value=\"\"\r\n                  name=\"rating-sort\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"rating-sort-2\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  3 Stars & Above\r\n                </label>\r\n              </div>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"RATINGS\",\r\n                      payload: { ratings: \"2STARSABOVE\" },\r\n                    })\r\n                  }\r\n                  checked={state.ratings === \"2STARSABOVE\" || false}\r\n                  id=\"rating-sort-3\"\r\n                  type=\"radio\"\r\n                  value=\"\"\r\n                  name=\"rating-sort\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"rating-sort-3\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  2 Stars & Above\r\n                </label>\r\n              </div>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"RATINGS\",\r\n                      payload: { ratings: \"1STARSABOVE\" },\r\n                    })\r\n                  }\r\n                  checked={state.ratings === \"1STARSABOVE\" || false}\r\n                  id=\"rating-sort-4\"\r\n                  type=\"radio\"\r\n                  value=\"\"\r\n                  name=\"rating-sort\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"rating-sort-4\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  1 Stars & Above\r\n                </label>\r\n              </div>\r\n            </li>\r\n            <li className=\"mt-1 mb-5\">\r\n              <span className=\"font-semibold\">Other Filters</span>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"BEST_SELLER_ONLY\",\r\n                      payload: { bestSellerOnly: !state.bestSellerOnly },\r\n                    })\r\n                  }\r\n                  checked={state.bestSellerOnly || false}\r\n                  id=\"best-seller\"\r\n                  type=\"checkbox\"\r\n                  value=\"\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"best-seller\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  Best Seller Only\r\n                </label>\r\n              </div>\r\n              <div className=\"flex items-center my-1\">\r\n                <input\r\n                  onChange={() =>\r\n                    dispatch({\r\n                      type: \"ONLY_IN_STOCK\",\r\n                      payload: { onlyInStock: !state.onlyInStock },\r\n                    })\r\n                  }\r\n                  checked={state.onlyInStock || false}\r\n                  id=\"only-instock\"\r\n                  type=\"checkbox\"\r\n                  value=\"\"\r\n                  className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\"\r\n                />\r\n                <label\r\n                  htmlFor=\"only-instock\"\r\n                  className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\"\r\n                >\r\n                  INSTOCK Only\r\n                </label>\r\n              </div>\r\n            </li>\r\n            <li className=\"mt-1 mb-5 px-1\">\r\n              <button\r\n                onClick={() => dispatch({ type: \"CLEAR_FILTER\" })}\r\n                type=\"button\"\r\n                className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\"\r\n              >\r\n                Clear Filter\r\n              </button>\r\n            </li>\r\n          </ul>\r\n        </div>\r\n      </div>\r\n    </section>\r\n  );\r\n};\r\n"
  },
  {
    "path": "114/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "114/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "114/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "114/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "114/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "115/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "115/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "115/data/db.json",
    "content": "{\r\n    \"products\": [\r\n      {\r\n        \"id\": 10001,\r\n        \"name\": \"Basics To Advanced In React\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10001.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 5,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10002,\r\n        \"name\": \"Django Framework for Beginners\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10002.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10003,\r\n        \"name\": \"The Future of Design Systems\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10003.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10005,\r\n        \"name\": \"Build a Blockchain from Scratch in Go\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10005.avif\",\r\n        \"rating\": 3,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10007,\r\n        \"name\": \"Master the Code Review\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10007.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 2,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10009,\r\n        \"name\": \"Python Deep Dive With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10009.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10010,\r\n        \"name\": \"Mastering Software Technique\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10010.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10011,\r\n        \"name\": \"Web Development Foundation\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10011.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10012,\r\n        \"name\": \"Mastering Git and GitHub - A Practical Guide\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10012.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10013,\r\n        \"name\": \"Everything About React v16\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10013.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10014,\r\n        \"name\": \"Diving Deep With Python 2.7\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 19,\r\n        \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10014.avif\",\r\n        \"rating\": 4,\r\n        \"in_stock\": false,\r\n        \"size\": 3,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10015,\r\n        \"name\": \"Kickstart Your UI Design Career\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 9,\r\n        \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10015.avif\",\r\n        \"rating\": 2,\r\n        \"in_stock\": false,\r\n        \"size\": 1,\r\n        \"best_seller\": false\r\n      }\r\n    ],\r\n    \"featured_products\": [\r\n      {\r\n        \"id\": 10004,\r\n        \"name\": \"The Complete Guide to Backend Development\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10004.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 7,\r\n        \"best_seller\": true\r\n      },\r\n      {\r\n        \"id\": 10006,\r\n        \"name\": \"Frontend Fastlane Plan With Projects\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 99,\r\n        \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10006.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 10,\r\n        \"best_seller\": false\r\n      },\r\n      {\r\n        \"id\": 10008,\r\n        \"name\": \"JavaScript Basics To Advance With Shubham\",\r\n        \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n        \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n        \"price\": 29,\r\n        \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n        \"image_local\": \"/assets/images/10008.avif\",\r\n        \"rating\": 5,\r\n        \"in_stock\": true,\r\n        \"size\": 3,\r\n        \"best_seller\": true\r\n      }\r\n    ],\r\n    \"orders\": [\r\n    ],\r\n    \"users\": [\r\n    ]\r\n}\r\n  "
  },
  {
    "path": "115/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "115/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "115/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "115/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "115/src/App.css",
    "content": ""
  },
  {
    "path": "115/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "115/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link href=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link href=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && <DropdownLoggedOut /> }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "115/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "115/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "115/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "115/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "115/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "115/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "115/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "115/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";"
  },
  {
    "path": "115/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "115/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "115/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"/products\" element={<ProductsList />} />\r\n        <Route path=\"/products/:id\" element={<ProductDetail />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "115/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "118/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "118/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "118/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    }\n  ]\n}"
  },
  {
    "path": "118/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "118/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "118/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "118/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "118/src/App.css",
    "content": ""
  },
  {
    "path": "118/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "118/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && <DropdownLoggedOut /> }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "118/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "118/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "118/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "118/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "118/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "118/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "118/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "118/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/Register.js",
    "content": "export const Register = () => {\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json()\r\n    console.log(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "118/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "118/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "118/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "118/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "119/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "119/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "119/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "119/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "119/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "119/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "119/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "119/src/App.css",
    "content": ""
  },
  {
    "path": "119/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "119/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && <DropdownLoggedOut /> }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "119/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "119/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "119/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "119/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "119/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "119/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "119/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "119/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Login.js",
    "content": "export const Login = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "119/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "119/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "119/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "119/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "120/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "120/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "120/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "120/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "120/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "120/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "120/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "120/src/App.css",
    "content": ""
  },
  {
    "path": "120/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "120/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && <DropdownLoggedOut /> }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "120/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "120/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "120/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "120/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "120/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "120/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "120/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "120/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "120/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "120/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "120/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "120/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "121/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "121/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "121/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "121/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "121/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "121/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "121/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "121/src/App.css",
    "content": ""
  },
  {
    "path": "121/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "121/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = () => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = () => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn /> : <DropdownLoggedOut /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "121/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "121/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "121/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "121/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "121/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "121/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "121/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "121/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "121/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "121/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "121/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "121/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "122/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "122/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "122/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "122/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "122/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "122/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "122/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "122/src/App.css",
    "content": ""
  },
  {
    "path": "122/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "122/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "122/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "122/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "122/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "122/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "122/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "122/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "122/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "122/src/pages/Cart/CartPage.js",
    "content": "export const CartPage = () => {\r\n  return (\r\n    <main>          \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Cart/components/CartCard.js",
    "content": "export const CartCard = () => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n          </a>\r\n          <div className=\"\">\r\n            <a href=\"\">\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n            </a>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>$29</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Cart/components/CartEmpty.js",
    "content": "export const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Cart/components/CartList.js",
    "content": "export const CartList = () => {\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n        {/* Cart Cards */}\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = () => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "122/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "122/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "122/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "122/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "123/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "123/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "123/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "123/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "123/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "123/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "123/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "123/src/App.css",
    "content": ""
  },
  {
    "path": "123/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "123/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "123/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "123/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "123/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "123/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";"
  },
  {
    "path": "123/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "123/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "123/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <FilterProvider>\n        <ScrollToTop />\n        <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n        <App />\n      </FilterProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "123/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\n\r\nexport const CartPage = () => {\r\n  const cartlistLength = 0;\r\n\r\n  return (\r\n    <main>       \r\n      { cartlistLength ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartCard = ({product}) => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  \r\n  const cartlist = [\r\n    {\r\n      \"id\": 10001,\r\n      \"name\": \"Basics To Advanced In React\",\r\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n      \"price\": 29,\r\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n      \"image_local\": \"/assets/images/10001.avif\",\r\n      \"rating\": 5,\r\n      \"in_stock\": true,\r\n      \"size\": 5,\r\n      \"best_seller\": true\r\n    },\r\n    {\r\n      \"id\": 10001,\r\n      \"name\": \"Basics To Advanced In React\",\r\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n      \"price\": 29,\r\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n      \"image_local\": \"/assets/images/10001.avif\",\r\n      \"rating\": 5,\r\n      \"in_stock\": true,\r\n      \"size\": 5,\r\n      \"best_seller\": true\r\n    }\r\n  ]\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartlist.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = ({setCheckout}) => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "123/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "123/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";"
  },
  {
    "path": "123/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<CartPage />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "123/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "124/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "124/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "124/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "124/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "124/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "124/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "124/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "124/src/App.css",
    "content": ""
  },
  {
    "path": "124/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "124/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "124/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "124/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "124/src/context/CartContext.js",
    "content": "import { createContext, useContext } from \"react\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n\r\n    const value = {\r\n        cartList: [],\r\n        total: 0\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "124/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "124/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "124/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "124/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "124/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "124/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\n\r\nexport const CartPage = () => {\r\n  const cartlistLength = 0;\r\n\r\n  return (\r\n    <main>       \r\n      { cartlistLength ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartCard = ({product}) => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  \r\n  const cartlist = [\r\n    {\r\n      \"id\": 10001,\r\n      \"name\": \"Basics To Advanced In React\",\r\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n      \"price\": 29,\r\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n      \"image_local\": \"/assets/images/10001.avif\",\r\n      \"rating\": 5,\r\n      \"in_stock\": true,\r\n      \"size\": 5,\r\n      \"best_seller\": true\r\n    },\r\n    {\r\n      \"id\": 10001,\r\n      \"name\": \"Basics To Advanced In React\",\r\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n      \"price\": 29,\r\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n      \"image_local\": \"/assets/images/10001.avif\",\r\n      \"rating\": 5,\r\n      \"in_stock\": true,\r\n      \"size\": 5,\r\n      \"best_seller\": true\r\n    }\r\n  ]\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartlist.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = ({setCheckout}) => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "124/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return\r\n        \r\n        case \"CLEAR_CART\":\r\n            return\r\n\r\n        case \"UPDATE_PRICE\":\r\n            return\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "124/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "124/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReduccer } from \"./cartReducers\";"
  },
  {
    "path": "124/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<CartPage />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "124/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "125/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "125/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "125/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "125/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "125/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "125/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "125/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "125/src/App.css",
    "content": ""
  },
  {
    "path": "125/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "125/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\n\r\nexport const Header = () => {\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">0</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "125/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "125/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "125/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "125/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "125/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "125/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "125/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "125/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "125/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\n\r\nexport const CartPage = () => {\r\n  const cartlistLength = 0;\r\n\r\n  return (\r\n    <main>       \r\n      { cartlistLength ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartCard = ({product}) => {\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  \r\n  const cartlist = [\r\n    {\r\n      \"id\": 10001,\r\n      \"name\": \"Basics To Advanced In React\",\r\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n      \"price\": 29,\r\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n      \"image_local\": \"/assets/images/10001.avif\",\r\n      \"rating\": 5,\r\n      \"in_stock\": true,\r\n      \"size\": 5,\r\n      \"best_seller\": true\r\n    },\r\n    {\r\n      \"id\": 10001,\r\n      \"name\": \"Basics To Advanced In React\",\r\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\r\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\r\n      \"price\": 29,\r\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\r\n      \"image_local\": \"/assets/images/10001.avif\",\r\n      \"rating\": 5,\r\n      \"in_stock\": true,\r\n      \"size\": 5,\r\n      \"best_seller\": true\r\n    }\r\n  ]\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart (2)\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartlist.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>$99</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = ({setCheckout}) => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "125/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "125/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "125/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "125/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<CartPage />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "125/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "126/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "126/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "126/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "126/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "126/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "126/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "126/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "126/src/App.css",
    "content": ""
  },
  {
    "path": "126/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "126/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/components/Elements/ProductCard.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    function handleClick(product){\r\n        addToCart(product);\r\n    }\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                <button onClick={() => handleClick(product)} className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "126/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "126/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "126/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "126/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "126/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "126/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "126/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "126/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "126/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Cart/components/Checkout.js",
    "content": "export const Checkout = ({setCheckout}) => {\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        $99\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\n\r\nexport const ProductDetail = () => {\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button>\r\n                {/* <button className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> */}\r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "126/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "126/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "126/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "126/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<CartPage />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "126/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "127/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "127/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "127/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "127/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "127/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "127/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "127/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "127/src/App.css",
    "content": ""
  },
  {
    "path": "127/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "127/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800\">Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className=\"inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800\">Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "127/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "127/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "127/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "127/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "127/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "127/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "127/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "127/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "127/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Cart/components/Checkout.js",
    "content": "import { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { total } = useCart();\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        ${total}\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800`}>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "127/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "127/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "127/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "127/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<CartPage />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "127/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "128/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "128/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "128/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "128/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "128/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "128/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "128/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "128/src/App.css",
    "content": ""
  },
  {
    "path": "128/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "128/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "128/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "128/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "128/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "128/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "128/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "128/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "128/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "128/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "128/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Cart/components/Checkout.js",
    "content": "import { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { total } = useCart();\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        ${total}\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "128/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "128/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "128/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "128/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<CartPage />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "128/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "129/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "129/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "129/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    }\n  ]\n}"
  },
  {
    "path": "129/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "129/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "129/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "129/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "129/src/App.css",
    "content": ""
  },
  {
    "path": "129/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "129/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "129/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "129/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "129/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "129/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "129/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "129/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "129/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "129/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "129/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Cart/components/Checkout.js",
    "content": "import { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { total } = useCart();\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"Shubham Sarda\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"shubham@example.com\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        ${total}\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "129/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "129/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "129/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "129/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "129/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "129/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "130/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "130/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "130/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "130/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "130/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "130/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "130/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "130/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "130/src/App.css",
    "content": ""
  },
  {
    "path": "130/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "130/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "130/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "130/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "130/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "130/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "130/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "130/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "130/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "130/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "130/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Cart/components/Checkout.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { total } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  useEffect(() => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n\r\n    getUser();\r\n  }, []);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name} disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email} disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        ${total}\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "130/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "130/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "130/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "130/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "130/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "130/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "131/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "131/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "131/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "131/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "131/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "131/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "131/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "131/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "131/src/App.css",
    "content": ""
  },
  {
    "path": "131/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "131/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "131/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "131/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "131/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "131/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "131/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "131/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "131/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "131/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "131/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Cart/components/Checkout.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { total } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  useEffect(() => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n\r\n    getUser();\r\n  }, []);\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form className=\"space-y-6\" >\r\n                    <div>\r\n                        <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                        <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                        <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                        <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                    </div>\r\n                    <div className=\"\">\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                        <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                        <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                    </div>\r\n                    <div>\r\n                        <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                        <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                    </div>\r\n                    <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                        ${total}\r\n                    </p>\r\n                    <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                        <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                    </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "131/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "131/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "131/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "131/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "131/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "131/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "132/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "132/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "132/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "132/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\",\r\n    \"/orders*\": \"/660/\"\r\n}"
  },
  {
    "path": "132/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "132/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "132/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "132/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "132/src/App.css",
    "content": ""
  },
  {
    "path": "132/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "132/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "132/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "132/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "132/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "132/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "132/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "132/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "132/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "132/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "132/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n    getUser();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${token}` },\r\n        body: JSON.stringify(order)\r\n    });\r\n    const data = await response.json();\r\n    clearCart();\r\n    navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Order/OrderPage.js",
    "content": "export const OrderPage = () => {\r\n  return (\r\n    <div>OrderPage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Order/components/OrderFail.js",
    "content": "export const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Order/components/OrderSuccess.js",
    "content": "export const OrderSuccess = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you user name for order!</p>\r\n            <p>Your Order ID: user id</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail (user@email.com) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "132/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "132/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "132/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "132/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "132/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "132/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "133/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "133/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "133/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "133/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\",\r\n    \"/orders*\": \"/660/\"\r\n}"
  },
  {
    "path": "133/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "133/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "133/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "133/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "133/src/App.css",
    "content": ""
  },
  {
    "path": "133/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "133/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "133/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "133/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "133/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "133/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "133/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "133/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "133/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "133/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "133/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n    getUser();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const order = {\r\n            cartList: cartList,\r\n            amount_paid: total,\r\n            quantity: cartList.length,\r\n            user: {\r\n                name: user.name,\r\n                email: user.email,\r\n                id: user.id\r\n            }\r\n        }\r\n        const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${token}` },\r\n        body: JSON.stringify(order)\r\n        });\r\n        const data = await response.json();\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Dashboard/DashbaordPage.js",
    "content": "export const DashbaordPage = () => {\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Dashboard/components/DashbaordCard.js",
    "content": "export const DashbaordCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Dashboard/components/DashbaordEmpty.js",
    "content": "export const DashbaordEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "133/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "133/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "133/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "133/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "133/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "133/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "134/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "134/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "134/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "134/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\",\r\n    \"/orders*\": \"/660/\"\r\n}"
  },
  {
    "path": "134/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "134/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "134/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "134/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "134/src/App.css",
    "content": ""
  },
  {
    "path": "134/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "134/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "134/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "134/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "134/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "134/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "134/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "134/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "134/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "134/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "134/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n    getUser();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const order = {\r\n            cartList: cartList,\r\n            amount_paid: total,\r\n            quantity: cartList.length,\r\n            user: {\r\n                name: user.name,\r\n                email: user.email,\r\n                id: user.id\r\n            }\r\n        }\r\n        const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${token}` },\r\n        body: JSON.stringify(order)\r\n        });\r\n        const data = await response.json();\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Dashboard/DashboardPage.js",
    "content": "import { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\"\r\n\r\nexport const DashboardPage = () => {\r\n  const orders = [];\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Dashboard/components/DashboardCard.js",
    "content": "export const DashboardCard = () => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: 1234</span>\r\n            <span>Total: $29</span>\r\n        </div>\r\n        <div className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n            <div className=\"flex\">\r\n                <a href=\"\">\r\n                    <img className=\"w-32 rounded\" src=\"\" alt=\"\" />\r\n                </a>\r\n                <div className=\"\">\r\n                    <a href=\"\">\r\n                        <p className=\"text-lg ml-2 dark:text-slate-200\">The Complete Guide to Backend Development</p>\r\n                    </a>\r\n                    <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                        <span>$29</span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "134/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "134/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "134/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "134/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "134/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "134/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "135/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "135/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "135/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "135/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\",\r\n    \"/orders*\": \"/660/\"\r\n}"
  },
  {
    "path": "135/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "135/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "135/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "135/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "135/src/App.css",
    "content": ""
  },
  {
    "path": "135/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "135/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        sessionStorage.removeItem(\"token\");\r\n        sessionStorage.removeItem(\"cbid\");\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "135/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "135/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "135/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "135/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "135/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "135/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "135/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "135/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "135/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n    getUser();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const order = {\r\n            cartList: cartList,\r\n            amount_paid: total,\r\n            quantity: cartList.length,\r\n            user: {\r\n                name: user.name,\r\n                email: user.email,\r\n                id: user.id\r\n            }\r\n        }\r\n        const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${token}` },\r\n        body: JSON.stringify(order)\r\n        });\r\n        const data = await response.json();\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\"\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      const response = await fetch(`http://localhost:8000/660/orders?user.id=${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n      });\r\n      const data = await response.json();\r\n      setOrders(data);\r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const requestOptions = {\r\n      method: \"POST\",\r\n      headers: {\"content-Type\": \"application/json\"},\r\n      body: JSON.stringify(authDetail)\r\n    }\r\n\r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    const data = await response.json();\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n\r\n    if(data.accessToken){\r\n      sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n      sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "135/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "135/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "135/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "135/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "135/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "135/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "136/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "136/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "136/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "136/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\",\r\n    \"/orders*\": \"/660/\"\r\n}"
  },
  {
    "path": "136/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "136/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "136/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "136/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "136/src/App.css",
    "content": ""
  },
  {
    "path": "136/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "136/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { Link, useNavigate } from \"react-router-dom\";\r\nimport { logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">shubham@example.com</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "136/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "136/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "136/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "136/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "136/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "136/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "136/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "136/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "136/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function getUser(){\r\n        const response = await fetch(`http://localhost:8000/600/users/${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n        });\r\n        const data = await response.json();\r\n        setUser(data);\r\n    }\r\n    getUser();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const order = {\r\n            cartList: cartList,\r\n            amount_paid: total,\r\n            quantity: cartList.length,\r\n            user: {\r\n                name: user.name,\r\n                email: user.email,\r\n                id: user.id\r\n            }\r\n        }\r\n        const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${token}` },\r\n        body: JSON.stringify(order)\r\n        });\r\n        const data = await response.json();\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\"\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n  const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      const response = await fetch(`http://localhost:8000/660/orders?user.id=${cbid}`, {\r\n            method: \"GET\",\r\n            headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${token}`}\r\n      });\r\n      const data = await response.json();\r\n      setOrders(data);\r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const data = await login(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const data = await register(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "136/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "136/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "136/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "136/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "136/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "136/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n      }\r\n  \r\n      const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n      const data = await response.json();\r\n        \r\n      if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n      }\r\n\r\n      return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "136/src/services/dataService.js",
    "content": ""
  },
  {
    "path": "136/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";"
  },
  {
    "path": "136/src/services/productService.js",
    "content": ""
  },
  {
    "path": "136/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "137/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "137/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "137/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 6\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "137/data/routes.json",
    "content": "{\r\n    \"/users*\": \"/600/\",\r\n    \"/orders*\": \"/660/\"\r\n}"
  },
  {
    "path": "137/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "137/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "137/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "137/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "137/src/App.css",
    "content": ""
  },
  {
    "path": "137/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "137/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            const data = await getUser();\r\n            data.email ? setUser(data) : handleLogout();\r\n        }\r\n        fetchData();\r\n    }, []);\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "137/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "137/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "137/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "137/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "137/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "137/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "137/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "137/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "137/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        const data = await getUser();\r\n        setUser(data);\r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\"\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      const data = await getUserOrders();\r\n      setOrders(data);\r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(\"http://localhost:8000/featured_products\");\r\n      const data = await response.json()\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const data = await login(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products/${id}`);\r\n      const data = await response.json()\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { useFilter } from \"../../context\";\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const response = await fetch(`http://localhost:8000/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n      const data = await response.json()\r\n      \r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const data = await register(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "137/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "137/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "137/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "137/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "137/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "137/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n      }\r\n  \r\n      const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n      const data = await response.json();\r\n        \r\n      if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n      }\r\n\r\n      return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "137/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`http://localhost:8000/600/users/${browserData.cbid}`, requestOptions);\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const response = await fetch(`http://localhost:8000/660/orders?user.id=${browserData.cbid}`, {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n    method: \"POST\",\r\n    headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n    body: JSON.stringify(order)\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "137/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";"
  },
  {
    "path": "137/src/services/productService.js",
    "content": ""
  },
  {
    "path": "137/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "138/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "138/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "138/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 6\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 7\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "138/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "138/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "138/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "138/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "138/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "138/src/App.css",
    "content": ""
  },
  {
    "path": "138/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "138/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            const data = await getUser();\r\n            data.email ? setUser(data) : handleLogout();\r\n        }\r\n        fetchData();\r\n    }, []);\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "138/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "138/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "138/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "138/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "138/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "138/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "138/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "138/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "138/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        const data = await getUser();\r\n        setUser(data);\r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\"\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      const data = await getUserOrders();\r\n      setOrders(data);\r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getFeaturedList();\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const data = await login(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src=\"\" alt=\"\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <a href=\"\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </a>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getProduct(id);\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getProductList(searchTerm);\r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const data = await register(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";"
  },
  {
    "path": "138/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "138/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "138/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "138/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "138/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "138/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n      }\r\n  \r\n      const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n      const data = await response.json();\r\n        \r\n      if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n      }\r\n\r\n      return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "138/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`http://localhost:8000/600/users/${browserData.cbid}`, requestOptions);\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const response = await fetch(`http://localhost:8000/660/orders?user.id=${browserData.cbid}`, {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n    method: \"POST\",\r\n    headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n    body: JSON.stringify(order)\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "138/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "138/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`http://localhost:8000/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`http://localhost:8000/444/products/${id}`);\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(\"http://localhost:8000/444/featured_products\");\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "138/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "139/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "139/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "139/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 6\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 7\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "139/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "139/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "139/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "139/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "139/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "139/src/App.css",
    "content": ""
  },
  {
    "path": "139/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "139/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            const data = await getUser();\r\n            data.email ? setUser(data) : handleLogout();\r\n        }\r\n        fetchData();\r\n    }, []);\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "139/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "139/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "139/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "139/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "139/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "139/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "139/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "139/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "139/src/pages/Cart/CartPage.js",
    "content": "import { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\nconst { cartList } = useCart();\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        const data = await getUser();\r\n        setUser(data);\r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\"\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      const data = await getUserOrders();\r\n      setOrders(data);\r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getFeaturedList();\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const data = await login(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Order/OrderPage.js",
    "content": "import { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const OrderPage = () => {\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src={Logo} alt=\"CodeBook Page Not Found\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <Link to=\"/\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </Link>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getProduct(id);\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getProductList(searchTerm);\r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const data = await register(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";\r\n"
  },
  {
    "path": "139/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "139/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "139/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "139/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n\r\n        <Route path=\"*\" element={<PageNotFound />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "139/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "139/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n      }\r\n  \r\n      const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n      const data = await response.json();\r\n        \r\n      if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n      }\r\n\r\n      return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "139/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`http://localhost:8000/600/users/${browserData.cbid}`, requestOptions);\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const response = await fetch(`http://localhost:8000/660/orders?user.id=${browserData.cbid}`, {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n    method: \"POST\",\r\n    headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n    body: JSON.stringify(order)\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "139/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "139/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`http://localhost:8000/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`http://localhost:8000/444/products/${id}`);\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(\"http://localhost:8000/444/featured_products\");\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "139/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "140/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "140/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "140/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 6\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 7\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 8\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "140/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "140/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "140/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "140/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "140/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "140/src/App.css",
    "content": ""
  },
  {
    "path": "140/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "140/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            const data = await getUser();\r\n            data.email ? setUser(data) : handleLogout();\r\n        }\r\n        fetchData();\r\n    }, []);\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "140/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "140/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "140/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "140/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "140/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "140/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "140/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "140/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "140/src/pages/Cart/CartPage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\n  const { cartList } = useCart();\r\n  useTitle(`Cart (${cartList.length})`);\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        const data = await getUser();\r\n        setUser(data);\r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\";\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n  useTitle(\"Dashboard\");\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      const data = await getUserOrders();\r\n      setOrders(data);\r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getFeaturedList();\r\n      setProducts(data);\r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  useTitle(\"Login\");\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      email: email.current.value,\r\n      password: password.current.value\r\n    }\r\n    const data = await login(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Order/OrderPage.js",
    "content": "import { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\n\r\nexport const OrderPage = () => {\r\n  useTitle(\"Order Summary\");\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const PageNotFound = () => {\r\n    useTitle(\"Page Not Found\");\r\n    \r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src={Logo} alt=\"CodeBook Page Not Found\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <Link to=\"/\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </Link>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getProduct(id);\r\n      setProduct(data);\r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      const data = await getProductList(searchTerm);\r\n      initialProductList(data);\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  useTitle(\"Register\");\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    const authDetail = {\r\n      name: event.target.name.value,\r\n      email: event.target.email.value,\r\n      password: event.target.password.value\r\n    }\r\n    const data = await register(authDetail);\r\n    data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";\r\n"
  },
  {
    "path": "140/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "140/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "140/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "140/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n\r\n        <Route path=\"*\" element={<PageNotFound />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "140/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "140/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n      }\r\n  \r\n      const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n      const data = await response.json();\r\n        \r\n      if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n      }\r\n\r\n      return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "140/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`http://localhost:8000/600/users/${browserData.cbid}`, requestOptions);\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const response = await fetch(`http://localhost:8000/660/orders?user.id=${browserData.cbid}`, {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/660/orders\", {\r\n    method: \"POST\",\r\n    headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n    body: JSON.stringify(order)\r\n    });\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "140/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "140/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`http://localhost:8000/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`http://localhost:8000/444/products/${id}`);\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(\"http://localhost:8000/444/featured_products\");\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "140/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "141/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "141/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "141/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 6\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 7\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 8\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "141/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "141/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "141/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "141/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "141/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "141/src/App.css",
    "content": ""
  },
  {
    "path": "141/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "141/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            try{\r\n                const data = await getUser();\r\n                data.email ? setUser(data) : handleLogout();\r\n            } catch(error){\r\n                toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n            }            \r\n        }\r\n        fetchData();\r\n    }, []);\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "141/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "141/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "141/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "141/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "141/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "141/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "141/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "141/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "141/src/pages/Cart/CartPage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\n  const { cartList } = useCart();\r\n  useTitle(`Cart (${cartList.length})`);\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        try{\r\n            const data = await getUser();\r\n            setUser(data);\r\n        } catch(error){\r\n            toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        }        \r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\";\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n  useTitle(\"Dashboard\");\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      try{\r\n        const data = await getUserOrders();\r\n        setOrders(data);\r\n      } catch(error){\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getFeaturedList();\r\n        setProducts(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  useTitle(\"Login\");\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        email: email.current.value,\r\n        password: password.current.value\r\n      }\r\n      const data = await login(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Order/OrderPage.js",
    "content": "import { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\n\r\nexport const OrderPage = () => {\r\n  useTitle(\"Order Summary\");\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const PageNotFound = () => {\r\n    useTitle(\"Page Not Found\");\r\n    \r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src={Logo} alt=\"CodeBook Page Not Found\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <Link to=\"/\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </Link>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProduct(id);\r\n        setProduct(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProductList(searchTerm);\r\n        initialProductList(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  useTitle(\"Register\");\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        name: event.target.name.value,\r\n        email: event.target.email.value,\r\n        password: event.target.password.value\r\n      }\r\n      const data = await register(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";\r\n"
  },
  {
    "path": "141/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "141/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "141/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "141/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n\r\n        <Route path=\"*\" element={<PageNotFound />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "141/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "141/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/login\", requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }  \r\n    const response = await fetch(\"http://localhost:8000/register\", requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    \r\n    if(data.accessToken){\r\n    sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n    sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "141/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`http://localhost:8000/600/users/${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`http://localhost:8000/660/orders?user.id=${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n        body: JSON.stringify(order)\r\n    }\r\n    const response = await fetch(\"http://localhost:8000/660/orders\", requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "141/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "141/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`http://localhost:8000/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`http://localhost:8000/444/products/${id}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(\"http://localhost:8000/444/featured_products\");\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "141/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "142/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "142/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "142/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 227,\n      \"quantity\": 3,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 1\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 2\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 3\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 99,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 4\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 5\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Alex T\",\n        \"email\": \"alex@example.com\",\n        \"id\": 3\n      },\n      \"id\": 6\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10002,\n          \"name\": \"Django Framework for Beginners\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 19,\n          \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10002.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 2,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 48,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 7\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10004,\n          \"name\": \"The Complete Guide to Backend Development\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10004.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 7,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10006,\n          \"name\": \"Frontend Fastlane Plan With Projects\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 99,\n          \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10006.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 10,\n          \"best_seller\": false\n        }\n      ],\n      \"amount_paid\": 198,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 8\n    },\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 29,\n      \"quantity\": 1,\n      \"user\": {\n        \"name\": \"Shubham\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 9\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$jwZkkaP6gmxOGuGUtnRS1u/SLjaFChpjGI4lTNp8FxkYmrY/JgLjO\",\n      \"name\": \"Shubham\",\n      \"id\": 1\n    },\n    {\n      \"email\": \"shubham@gmail.com\",\n      \"password\": \"$2a$10$dXSd9HPDmszaTiKJ5iB4K.IXuD5ejSi2GlBJNvAXRtMgmGhSLwIQK\",\n      \"name\": \"Shubham\",\n      \"id\": 2\n    },\n    {\n      \"email\": \"alex@example.com\",\n      \"password\": \"$2a$10$EAegJLvG5i3K.lPc9hMILua.sPTawvjUE1F3xO.3CMTml6vHRyvFm\",\n      \"name\": \"Alex T\",\n      \"id\": 3\n    }\n  ]\n}"
  },
  {
    "path": "142/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "142/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "142/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "142/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "142/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "142/src/App.css",
    "content": ""
  },
  {
    "path": "142/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "142/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            try{\r\n                const data = await getUser();\r\n                data.email ? setUser(data) : handleLogout();\r\n            } catch(error){\r\n                toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n            }            \r\n        }\r\n        fetchData();\r\n    }, []);\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, image_local, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={image_local} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "142/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "142/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "142/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "142/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "142/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "142/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "142/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "142/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "142/src/pages/Cart/CartPage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\n  const { cartList } = useCart();\r\n  useTitle(`Cart (${cartList.length})`);\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <a href=\"\">\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </a>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        try{\r\n            const data = await getUser();\r\n            setUser(data);\r\n        } catch(error){\r\n            toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        }        \r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\";\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n  useTitle(\"Dashboard\");\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      try{\r\n        const data = await getUserOrders();\r\n        setOrders(data);\r\n      } catch(error){\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getFeaturedList();\r\n        setProducts(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  useTitle(\"Login\");\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        email: email.current.value,\r\n        password: password.current.value\r\n      }\r\n      const data = await login(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        {/* <button className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button> */}\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Order/OrderPage.js",
    "content": "import { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\n\r\nexport const OrderPage = () => {\r\n  useTitle(\"Order Summary\");\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const PageNotFound = () => {\r\n    useTitle(\"Page Not Found\");\r\n    \r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src={Logo} alt=\"CodeBook Page Not Found\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <Link to=\"/\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </Link>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProduct(id);\r\n        setProduct(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProductList(searchTerm);\r\n        initialProductList(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]);\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { toast } from 'react-toastify';\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  useTitle(\"Register\");\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        name: event.target.name.value,\r\n        email: event.target.email.value,\r\n        password: event.target.password.value\r\n      }\r\n      const data = await register(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";\r\n"
  },
  {
    "path": "142/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "142/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "142/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "142/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n\r\n        <Route path=\"*\" element={<PageNotFound />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "142/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "142/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/login`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }  \r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/register`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    \r\n    if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "142/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/600/users/${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/660/orders?user.id=${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n        body: JSON.stringify(order)\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/660/orders`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "142/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "142/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/products/${id}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/featured_products`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status };\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "142/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "144/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\r\n\r\n# dependencies\r\n/node_modules\r\n/.pnp\r\n.pnp.js\r\n\r\n# testing\r\n/coverage\r\n\r\n# production\r\n/build\r\n\r\n# misc\r\n.DS_Store\r\n.env\r\n.env.local\r\n.env.development.local\r\n.env.test.local\r\n.env.production.local\r\n\r\nnpm-debug.log*\r\nyarn-debug.log*\r\nyarn-error.log*\r\n"
  },
  {
    "path": "144/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 58,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham Sarda\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 1\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$K9aEH3/VDb2QU/EsjrHGJO7X5JxCcg0bMAnBtyT3kBW9FL7FnnygO\",\n      \"name\": \"Shubham Sarda\",\n      \"id\": 1\n    }\n  ]\n}"
  },
  {
    "path": "144/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "144/index.js",
    "content": "import express from \"express\";\r\nimport jsonServer from \"json-server\";\r\nimport auth from \"json-server-auth\";\r\n\r\nconst server = express();\r\nserver.use((req, res, next) => {\r\n    res.header('Access-Control-Allow-Origin', '*')\r\n    res.header('Access-Control-Allow-Headers', '*')\r\n    next()\r\n})\r\n\r\nconst router = jsonServer.router('./data/db.json');\r\nserver.use('/api', router);\r\nserver.db = router.db\r\n\r\nconst middlewares = jsonServer.defaults()\r\nconst rules = auth.rewriter({\r\n    products: 444,\r\n    featured_products: 444,\r\n    orders: 660,\r\n    users: 600\r\n});\r\n\r\nserver.use(rules)\r\nserver.use(auth)\r\nserver.use(middlewares)\r\nserver.use(router)\r\n\r\nserver.listen(8000);\r\n"
  },
  {
    "path": "144/package.json",
    "content": "{\n  \"name\": \"codebook-mock-server\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"start\": \"node index.js\",\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"express\": \"^4.18.1\"\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\"\n  }\n}\n"
  },
  {
    "path": "145/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "145/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "145/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 58,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham Sarda\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 1\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$K9aEH3/VDb2QU/EsjrHGJO7X5JxCcg0bMAnBtyT3kBW9FL7FnnygO\",\n      \"name\": \"Shubham Sarda\",\n      \"id\": 1\n    }\n  ]\n}"
  },
  {
    "path": "145/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "145/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "145/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "145/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "145/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "145/src/App.css",
    "content": ""
  },
  {
    "path": "145/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "145/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            try{\r\n                const data = await getUser();\r\n                data.email ? setUser(data) : handleLogout();\r\n            } catch(error){\r\n                toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n            }            \r\n        }\r\n        fetchData();\r\n    }, []); //eslint-disable-line\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={poster} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "145/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "145/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "145/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "145/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "145/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "145/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "145/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "145/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "145/src/pages/Cart/CartPage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\n  const { cartList } = useCart();\r\n  useTitle(`Cart (${cartList.length})`);\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <Link to={`products/${product.id}`}>\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </Link>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        try{\r\n            const data = await getUser();\r\n            setUser(data);\r\n        } catch(error){\r\n            toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        }        \r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\";\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n  useTitle(\"Dashboard\");\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      try{\r\n        const data = await getUserOrders();\r\n        setOrders(data);\r\n      } catch(error){\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getFeaturedList();\r\n        setProducts(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  useTitle(\"Login\");\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        email: email.current.value,\r\n        password: password.current.value\r\n      }\r\n      const data = await login(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n  \r\n  async function handleLoginGuest(){\r\n    email.current.value = process.env.REACT_APP_GUEST_LOGIN;\r\n    password.current.value = process.env.REACT_APP_GUEST_PASSWORD;\r\n    try{\r\n      const authDetail = {\r\n        email: email.current.value,\r\n        password: password.current.value\r\n      }\r\n      const data = await login(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        <button onClick={handleLoginGuest} className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Order/OrderPage.js",
    "content": "import { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\n\r\nexport const OrderPage = () => {\r\n  useTitle(\"Order Summary\");\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const PageNotFound = () => {\r\n    useTitle(\"Page Not Found\");\r\n    \r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src={Logo} alt=\"CodeBook Page Not Found\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <Link to=\"/\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </Link>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProduct(id);\r\n        setProduct(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProductList(searchTerm);\r\n        initialProductList(data); \r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]); //eslint-disable-line\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  useTitle(\"Register\");\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        name: event.target.name.value,\r\n        email: event.target.email.value,\r\n        password: event.target.password.value\r\n      }\r\n      const data = await register(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";\r\n"
  },
  {
    "path": "145/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "145/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "145/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "145/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n\r\n        <Route path=\"*\" element={<PageNotFound />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "145/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "145/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/login`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }  \r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/register`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    \r\n    if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "145/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/600/users/${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/660/orders?user.id=${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n        body: JSON.stringify(order)\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/660/orders`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "145/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "145/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/products/${id}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/featured_products`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "145/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "147/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "147/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "147/data/db.json",
    "content": "{\n  \"products\": [\n    {\n      \"id\": 10001,\n      \"name\": \"Basics To Advanced In React\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10001.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 5,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10002,\n      \"name\": \"Django Framework for Beginners\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1580894894513-541e068a3e2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10002.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10003,\n      \"name\": \"The Future of Design Systems\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1523726491678-bf852e717f6a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10003.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10005,\n      \"name\": \"Build a Blockchain from Scratch in Go\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1639322537228-f710d846310a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10005.avif\",\n      \"rating\": 3,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10007,\n      \"name\": \"Master the Code Review\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1621839673705-6617adf9e890?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10007.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 2,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10009,\n      \"name\": \"Python Deep Dive With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1624953587687-daf255b6b80a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10009.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10010,\n      \"name\": \"Mastering Software Technique\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1623479322729-28b25c16b011?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10010.avif\",\n      \"rating\": 4,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10011,\n      \"name\": \"Web Development Foundation\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1507721999472-8ed4421c4af2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10011.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10012,\n      \"name\": \"Mastering Git and GitHub - A Practical Guide\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1618401471353-b98afee0b2eb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10012.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 1,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10013,\n      \"name\": \"Everything About React v16\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1633356122102-3fe601e05bd2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10013.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10014,\n      \"name\": \"Diving Deep With Python 2.7\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 19,\n      \"poster\": \"https://images.unsplash.com/photo-1515879218367-8466d910aaa4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10014.avif\",\n      \"rating\": 4,\n      \"in_stock\": false,\n      \"size\": 3,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10015,\n      \"name\": \"Kickstart Your UI Design Career\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 9,\n      \"poster\": \"https://images.unsplash.com/photo-1587440871875-191322ee64b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10015.avif\",\n      \"rating\": 2,\n      \"in_stock\": false,\n      \"size\": 1,\n      \"best_seller\": false\n    }\n  ],\n  \"featured_products\": [\n    {\n      \"id\": 10004,\n      \"name\": \"The Complete Guide to Backend Development\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1595617795501-9661aafda72a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10004.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 7,\n      \"best_seller\": true\n    },\n    {\n      \"id\": 10006,\n      \"name\": \"Frontend Fastlane Plan With Projects\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 99,\n      \"poster\": \"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10006.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 10,\n      \"best_seller\": false\n    },\n    {\n      \"id\": 10008,\n      \"name\": \"JavaScript Basics To Advance With Shubham\",\n      \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n      \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n      \"price\": 29,\n      \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n      \"image_local\": \"/assets/images/10008.avif\",\n      \"rating\": 5,\n      \"in_stock\": true,\n      \"size\": 3,\n      \"best_seller\": true\n    }\n  ],\n  \"orders\": [\n    {\n      \"cartList\": [\n        {\n          \"id\": 10001,\n          \"name\": \"Basics To Advanced In React\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10001.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 5,\n          \"best_seller\": true\n        },\n        {\n          \"id\": 10008,\n          \"name\": \"JavaScript Basics To Advance With Shubham\",\n          \"overview\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error unde quisquam magni vel eligendi nam.\",\n          \"long_description\": \"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Soluta aut, vel ipsum maxime quam quia, quaerat tempore minus odio exercitationem illum et eos, quas ipsa aperiam magnam officiis libero expedita quo voluptas deleniti sit dolore? Praesentium tempora cumque facere consectetur quia, molestiae quam, accusamus eius corrupti laudantium aliquid! Tempore laudantium unde labore voluptates repellat, dignissimos aperiam ad ipsum laborum recusandae voluptatem non dolore. Reiciendis cum quo illum. Dolorem, molestiae corporis.\",\n          \"price\": 29,\n          \"poster\": \"https://images.unsplash.com/photo-1613490900233-141c5560d75d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=650&q=40\",\n          \"image_local\": \"/assets/images/10008.avif\",\n          \"rating\": 5,\n          \"in_stock\": true,\n          \"size\": 3,\n          \"best_seller\": true\n        }\n      ],\n      \"amount_paid\": 58,\n      \"quantity\": 2,\n      \"user\": {\n        \"name\": \"Shubham Sarda\",\n        \"email\": \"shubham@example.com\",\n        \"id\": 1\n      },\n      \"id\": 1\n    }\n  ],\n  \"users\": [\n    {\n      \"email\": \"shubham@example.com\",\n      \"password\": \"$2a$10$K9aEH3/VDb2QU/EsjrHGJO7X5JxCcg0bMAnBtyT3kBW9FL7FnnygO\",\n      \"name\": \"Shubham Sarda\",\n      \"id\": 1\n    }\n  ]\n}"
  },
  {
    "path": "147/data/routes.json",
    "content": "{\r\n    \"/products*\": \"/444/\",\r\n    \"/featured_products*\": \"/444/\",\r\n    \"/orders*\": \"/660/\",\r\n    \"/users*\": \"/600/\"\r\n}"
  },
  {
    "path": "147/netlify.toml",
    "content": "[[redirects]]\r\nfrom = \"/*\"\r\nto = \"/index.html\"\r\nstatus = 200"
  },
  {
    "path": "147/package.json",
    "content": "{\n  \"name\": \"codebook\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"react-toastify\": \"^9.0.8\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  },\n  \"devDependencies\": {\n    \"json-server\": \"^0.17.0\",\n    \"json-server-auth\": \"^2.1.0\",\n    \"tailwindcss\": \"^3.1.8\"\n  }\n}\n"
  },
  {
    "path": "147/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Access Latest Computer Science E-Books - CodeBook</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "147/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "147/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "147/src/App.css",
    "content": ""
  },
  {
    "path": "147/src/App.js",
    "content": "import { AllRoutes } from './routes/AllRoutes';\nimport { Footer, Header } from './components';\n\nfunction App() {\n  return (\n    <div className=\"App dark:bg-dark\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "147/src/components/Elements/DropdownLoggedIn.js",
    "content": "import { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport { Link, useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { getUser, logout } from \"../../services\";\r\n\r\nexport const DropdownLoggedIn = ({setDropdown}) => {\r\n    const navigate = useNavigate();\r\n    const [user, setUser] = useState({});\r\n\r\n    useEffect(() => {\r\n        async function fetchData(){\r\n            try{\r\n                const data = await getUser();\r\n                data.email ? setUser(data) : handleLogout();\r\n            } catch(error){\r\n                toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n            }            \r\n        }\r\n        fetchData();\r\n    }, []); //eslint-disable-line\r\n\r\n    function handleLogout(){\r\n        logout();\r\n        setDropdown(false);\r\n        navigate(\"/\");\r\n    }\r\n\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <div className=\"py-3 px-4 text-sm text-gray-900 dark:text-white\">\r\n            <div className=\"font-medium truncate\">{user.email}</div>\r\n        </div>\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/dashboard\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Dashboard</Link>\r\n            </li>\r\n        </ul>\r\n        <div className=\"py-1\">\r\n            <span onClick={handleLogout} className=\"cursor-pointer block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white\">Log out</span>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/components/Elements/DropdownLoggedOut.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const DropdownLoggedOut = ({setDropdown}) => {\r\n  return (\r\n    <div id=\"dropdownAvatar\" className=\"select-none\tabsolute top-10 right-0 z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600\">\r\n        <ul className=\"py-1 text-sm text-gray-700 dark:text-gray-200\" aria-labelledby=\"dropdownUserAvatarButton\">\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/products\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">All eBooks</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/login\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Login</Link>\r\n            </li>\r\n            <li>\r\n                <Link onClick={() => setDropdown(false)} to=\"/register\" className=\"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white\">Register</Link>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/components/Elements/ProductCard.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useCart } from \"../../context\";\r\nimport { Rating } from \"./Rating\";\r\n\r\nexport const ProductCard = ({product}) => {\r\n    const { cartList, addToCart, removeFromCart } = useCart();\r\n    const [inCart, setInCart] = useState(false);\r\n    const {id, name, overview, poster, price, rating, best_seller} = product;\r\n\r\n    useEffect(() => {\r\n        const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n        if(productInCart){\r\n            setInCart(true);\r\n        } else {\r\n            setInCart(false);\r\n        }\r\n\r\n    }, [cartList, product.id]);\r\n\r\n  return (\r\n    <div className=\"m-3 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700\">\r\n        <Link to={`/products/${id}`} className=\"relative\" >\r\n            { best_seller && <span className=\"absolute top-4 left-2 px-2 bg-orange-500 bg-opacity-90 text-white rounded\">Best Seller</span> }\r\n            <img className=\"rounded-t-lg w-full h-64\" src={poster} alt={name} />\r\n        </Link>\r\n        <div className=\"p-5\">\r\n            <Link to={`/products/${id}`}>\r\n                <h5 className=\"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white\">{name}</h5>\r\n            </Link>\r\n            <p className=\"mb-3 font-normal text-gray-700 dark:text-gray-400\">{overview}</p>\r\n            \r\n            <div className=\"flex items-center my-2\">\r\n                <Rating rating={rating} />\r\n            </div>\r\n\r\n            <p className=\"flex justify-between items-center\">\r\n                <span className=\"text-2xl dark:text-gray-200\">\r\n                    <span>$</span><span>{price}</span>\r\n                </span>\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> }  \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> } \r\n            </p>\r\n        </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/components/Elements/Rating.js",
    "content": "export const Rating = ({rating}) => {\r\n    let ratingArray = Array(5).fill(false);\r\n    for(let i=0; i<rating; i++){\r\n        ratingArray[i] = true;\r\n    }\r\n\r\n  return (\r\n    <>\r\n        { ratingArray.map((value, index) => (\r\n            value ? (\r\n                <i key={index} className=\"text-lg bi bi-star-fill text-yellow-500 mr-1\"></i>\r\n            ) : (\r\n                <i key={index} className=\"text-lg bi bi-star text-yellow-500 mr-1\"></i>\r\n            )\r\n        )) }\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/components/Layouts/Footer.js",
    "content": "import { Link } from \"react-router-dom\";\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer className=\"bg-white shadow dark:bg-gray-800\">\r\n        <div className=\"p-4 mx-auto max-w-screen-xl md:flex md:items-center md:justify-between md:p-6\">            \r\n            <span className=\"text-sm text-gray-500 sm:text-center dark:text-gray-400\">© 2030 <Link to=\"/\" className=\"hover:underline\">CodeBook</Link>. All Rights Reserved.</span>\r\n            <div className=\"flex mt-4 space-x-6 sm:justify-center sm:mt-0\">\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">Instagram page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84\" /></svg>\r\n                    <span className=\"sr-only\">Twitter page</span>\r\n                </Link>\r\n                <Link to=\"/\" target=\"_blank\" rel=\"noreferrer\" className=\"text-gray-500 hover:text-gray-900 dark:hover:text-white\">\r\n                    <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fillRule=\"evenodd\" d=\"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z\" clipRule=\"evenodd\" /></svg>\r\n                    <span className=\"sr-only\">GitHub account</span>\r\n                </Link>\r\n            </div>\r\n        </div>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/components/Layouts/Header.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport Logo from \"../../assets/logo.png\";\r\nimport { Search } from \"../Sections/Search\";\r\nimport { DropdownLoggedOut, DropdownLoggedIn } from \"../index\";\r\nimport { useCart } from \"../../context\";\r\n\r\nexport const Header = () => {\r\n  const { cartList } = useCart();\r\n  const [darkMode, setDarkMode] = useState(JSON.parse(localStorage.getItem(\"darkMode\")) || false);\r\n  const [searchSection, setSearchSection] = useState(false);\r\n  const [dropdown, setDropdown] = useState(false);\r\n  const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  useEffect(() => {\r\n    localStorage.setItem(\"darkMode\", JSON.stringify(darkMode));\r\n    \r\n    if(darkMode){\r\n      document.documentElement.classList.add(\"dark\");\r\n    } else {\r\n      document.documentElement.classList.remove(\"dark\");\r\n    }\r\n  }, [darkMode]);\r\n\r\n  return (\r\n    <header>      \r\n      <nav className=\"bg-white dark:bg-gray-900\">\r\n          <div className=\"border-b border-slate-200 dark:border-b-0 flex flex-wrap justify-between items-center mx-auto max-w-screen-xl px-4 md:px-6 py-3\">\r\n              <Link to=\"/\" className=\"flex items-center\">\r\n                  <img src={Logo} className=\"mr-3 h-10\" alt=\"CodeBook Logo\" />\r\n                  <span className=\"self-center text-2xl font-semibold whitespace-nowrap dark:text-white\">CodeBook</span>\r\n              </Link>\r\n              <div className=\"flex items-center relative\">\r\n                  <span onClick={() => setDarkMode(!darkMode)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-gear-wide-connected\"></span>\r\n                  <span onClick={() => setSearchSection(!searchSection)} className=\"cursor-pointer text-xl text-gray-700 dark:text-white mr-5 bi bi-search\"></span>\r\n                  <Link to=\"/cart\" className=\"text-gray-700 dark:text-white mr-5\">\r\n                    <span className=\"text-2xl bi bi-cart-fill relative\">\r\n                      <span className=\"text-white text-sm absolute -top-1 left-2.5 bg-rose-500 px-1 rounded-full \">{cartList.length}</span>\r\n                    </span>                    \r\n                  </Link>\r\n                  <span onClick={() => setDropdown(!dropdown)} className=\"bi bi-person-circle cursor-pointer text-2xl text-gray-700 dark:text-white\"></span>\r\n                  { dropdown && ( token ? <DropdownLoggedIn setDropdown={setDropdown} /> : <DropdownLoggedOut setDropdown={setDropdown} /> ) }\r\n              </div>\r\n          </div>\r\n      </nav>\r\n      { searchSection && <Search setSearchSection={setSearchSection} /> }\r\n      \r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/components/Other/ScrollToTop.js",
    "content": "import { useEffect } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nexport const ScrollToTop = () => {\r\n  const { pathname } = useLocation();\r\n\r\n  useEffect(() => {\r\n    window.scrollTo(0, 0);\r\n  }, [pathname]);\r\n\r\n  return null;\r\n}\r\n"
  },
  {
    "path": "147/src/components/Sections/Search.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const Search = ({setSearchSection}) => {\r\n  const navigate = useNavigate();\r\n  const searchRef = useRef();\r\n\r\n  const handleSearch = (event) => {\r\n    event.preventDefault();\r\n    setSearchSection(false);\r\n    navigate(`/products?q=${searchRef.current.value}`);\r\n  }\r\n\r\n  return (\r\n    <div className=\"mx-auto max-w-screen-xl p-2 my-5\">\r\n        <form onSubmit={handleSearch} className=\"flex items-center\">   \r\n            <div className=\"relative w-full\">\r\n                <span className=\"bi bi-search flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none\"></span>\r\n                <input ref={searchRef} name=\"search\" type=\"text\" id=\"simple-search\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5  dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"Search\" autoComplete=\"off\" required=\"\" />\r\n            </div>\r\n            <button type=\"submit\" className=\"bi bi-search py-2.5 px-3 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">\r\n            </button>\r\n        </form>\r\n    </div>\r\n  )\r\n}"
  },
  {
    "path": "147/src/components/index.js",
    "content": "export { Header } from \"./Layouts/Header\";\r\nexport { Footer } from \"./Layouts/Footer\";\r\n\r\nexport { ProductCard } from \"./Elements/ProductCard\";\r\nexport { Rating } from \"./Elements/Rating\";\r\n\r\nexport { DropdownLoggedIn } from \"./Elements/DropdownLoggedIn\";\r\nexport { DropdownLoggedOut } from \"./Elements/DropdownLoggedOut\";\r\n\r\nexport { ScrollToTop } from \"./Other/ScrollToTop\";"
  },
  {
    "path": "147/src/context/CartContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\";\r\nimport { cartReducer } from \"../reducers\";\r\n\r\nconst cartInitialState = {\r\n    cartList: [],\r\n    total: 0\r\n}\r\n\r\nconst CartContext = createContext(cartInitialState);\r\n\r\nexport const CartProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(cartReducer, cartInitialState);\r\n\r\n    function addToCart(product){\r\n        const updatedList = state.cartList.concat(product);\r\n        const updatedTotal = state.total + product.price;\r\n\r\n        dispatch({\r\n            type: \"ADD_TO_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function removeFromCart(product){\r\n        const updatedList = state.cartList.filter(item => item.id !== product.id);\r\n        const updatedTotal = state.total - product.price;\r\n\r\n        dispatch({\r\n            type: \"REMOVE_FROM_CART\",\r\n            payload: {\r\n                products: updatedList,\r\n                total: updatedTotal\r\n            }\r\n        })\r\n    }\r\n\r\n    function clearCart(){\r\n        dispatch({\r\n            type: \"CLEAR_CART\",\r\n            payload: {\r\n                products: [],\r\n                total: 0\r\n            }\r\n        })\r\n    }\r\n\r\n    const value = {\r\n        cartList: state.cartList,\r\n        total: state.total,\r\n        addToCart,\r\n        removeFromCart,\r\n        clearCart\r\n    }\r\n\r\n    return (\r\n        <CartContext.Provider value={value}>\r\n            {children}\r\n        </CartContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useCart = () => {\r\n    const context = useContext(CartContext);\r\n    return context;\r\n}"
  },
  {
    "path": "147/src/context/FilterContext.js",
    "content": "import { createContext, useContext, useReducer } from \"react\"\r\nimport { filterReducer } from \"../reducers\";\r\n\r\nconst filterInitialState = {\r\n    productList: [],\r\n    onlyInStock: false,\r\n    bestSellerOnly: false,\r\n    sortBy: null,\r\n    ratings: null\r\n}\r\n\r\nconst FilterContext = createContext(filterInitialState);\r\n\r\nexport const FilterProvider = ({children}) => {\r\n    const [state, dispatch] = useReducer(filterReducer, filterInitialState);\r\n\r\n    function initialProductList(products){\r\n        dispatch({\r\n            type: \"PRODUCT_LIST\",\r\n            payload: {\r\n                products: products\r\n            }\r\n        });\r\n    }\r\n\r\n    function bestSeller(products){\r\n        return state.bestSellerOnly ? products.filter(product => product.best_seller === true) : products;\r\n    }\r\n\r\n    function inStock(products){\r\n        return state.onlyInStock ? products.filter(product => product.in_stock === true) : products;\r\n    }\r\n    \r\n    function sort(products){\r\n        if(state.sortBy === \"lowtohigh\"){\r\n            return products.sort((a, b) => Number(a.price) - Number(b.price));\r\n        }\r\n        if(state.sortBy === \"hightolow\"){\r\n            return products.sort((a, b) => Number(b.price) - Number(a.price));\r\n        }\r\n        return products;\r\n    }\r\n\r\n    function rating(products){\r\n        if(state.ratings === \"4STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 4);\r\n        }\r\n        if(state.ratings === \"3STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 3);\r\n        }\r\n        if(state.ratings === \"2STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 2);\r\n        }\r\n        if(state.ratings === \"1STARSABOVE\"){\r\n            return products.filter(product => product.rating >= 1);\r\n        }\r\n        return products;\r\n    }\r\n\r\n    const filteredProductList = rating(sort(inStock(bestSeller(state.productList))));\r\n\r\n    const value = {\r\n        state, \r\n        dispatch,\r\n        products: filteredProductList,\r\n        initialProductList\r\n    }\r\n    return (\r\n        <FilterContext.Provider value={value}>\r\n            {children}\r\n        </FilterContext.Provider>\r\n    )\r\n}\r\n\r\nexport const useFilter = () => {\r\n    const context = useContext(FilterContext);\r\n    return context;\r\n}"
  },
  {
    "path": "147/src/context/index.js",
    "content": "export { useFilter, FilterProvider } from \"./FilterContext\";\r\nexport { useCart, CartProvider } from \"./CartContext\";"
  },
  {
    "path": "147/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - CodeBook`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "147/src/index.css",
    "content": "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\r\n\r\n* {\r\n    font-family: 'Roboto', sans-serif;\r\n}\r\n\r\nmain {\r\n    min-height: 90vh;\r\n    max-width: 1280px;\r\n    margin: auto;\r\n    padding: 15px;\r\n}"
  },
  {
    "path": "147/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\nimport { FilterProvider, CartProvider } from \"./context\";\nimport { ScrollToTop } from \"./components\";\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <CartProvider>\n        <FilterProvider>\n          <ScrollToTop />\n          <ToastContainer closeButton={false} autoClose={3000} position={\"bottom-right\"} />\n          <App />\n        </FilterProvider>\n      </CartProvider>\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "147/src/pages/Cart/CartPage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { CartEmpty } from \"./components/CartEmpty\";\r\nimport { CartList } from \"./components/CartList\";\r\nimport { useCart } from \"../../context\"\r\n\r\nexport const CartPage = () => {\r\n  const { cartList } = useCart();\r\n  useTitle(`Cart (${cartList.length})`);\r\n\r\n  return (\r\n    <main>       \r\n      { cartList.length ? <CartList /> : <CartEmpty /> }   \r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Cart/components/CartCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport { useCart } from \"../../../context\";\r\n\r\nexport const CartCard = ({product}) => {\r\n  const { removeFromCart } = useCart();\r\n\r\n  return (\r\n    <div className=\"flex flex-wrap justify-between border-b dark:border-slate-700 max-w-4xl m-auto p-2 mb-5 \">\r\n      <div className=\"flex\">\r\n          <Link to={`products/${product.id}`}>\r\n            <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n          </Link>\r\n          <div className=\"\">\r\n            <Link to={`products/${product.id}`}>\r\n              <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n            </Link>            \r\n            <button onClick={() => removeFromCart(product)} className=\"text-base ml-2 text-red-400\">Remove</button>\r\n          </div>\r\n      </div>\r\n      <div className=\"text-lg m-2 dark:text-slate-200\">\r\n        <span>${product.price}</span>\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Cart/components/CartEmpty.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const CartEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your cart looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Cart/components/CartList.js",
    "content": "import { useState } from \"react\"\r\nimport { useCart } from \"../../../context\";\r\nimport { CartCard } from \"./CartCard\"\r\nimport { Checkout } from \"./Checkout\"\r\n\r\nexport const CartList = () => {\r\n  const [checkout, setCheckout] = useState(false);\r\n  const { cartList, total } = useCart();\r\n\r\n  return (\r\n    <>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">\r\n          My Cart ({cartList.length})\r\n        </p>\r\n      </section>\r\n      \r\n      <section>\r\n       { cartList.map((product) => (\r\n        <CartCard key={product.id} product={product} />\r\n       )) }\r\n      </section>\r\n\r\n      <section className=\"max-w-4xl m-auto\">\r\n        <div className=\"flex flex-col p-2 border-b dark:border-slate-700 text-lg dark:text-slate-100\">\r\n          <p className=\"flex justify-between my-2\">\r\n            <span className=\"font-semibold\">Total Amount:</span>\r\n            <span>${total}</span>\r\n          </p>\r\n        </div>\r\n        <div className=\"text-right my-5\">\r\n          <button onClick={() => setCheckout(true)} type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-base px-7 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700\">\r\n            PLACE ORDER <i className=\"ml-2 bi bi-arrow-right\"></i>\r\n          </button>\r\n        </div>\r\n      </section>\r\n      { checkout && <Checkout setCheckout={setCheckout} />}\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Cart/components/Checkout.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useCart } from \"../../../context\";\r\nimport { createOrder, getUser } from \"../../../services\";\r\n\r\nexport const Checkout = ({setCheckout}) => {\r\n  const { cartList, total, clearCart } = useCart();\r\n  const [user, setUser] = useState({});\r\n\r\n  const navigate = useNavigate();\r\n\r\n  useEffect(() => {\r\n    async function fetchData(){\r\n        try{\r\n            const data = await getUser();\r\n            setUser(data);\r\n        } catch(error){\r\n            toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        }        \r\n    }\r\n    fetchData();\r\n  }, []);\r\n\r\n  async function handleOrderSubmit(event){\r\n    event.preventDefault();\r\n    try {\r\n        const data = await createOrder(cartList, total, user);\r\n        clearCart();\r\n        navigate(\"/order-summary\", { state: {data: data, status: true} });\r\n    } catch(error) {\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n        navigate(\"/order-summary\", { state: {status: false} });\r\n    }\r\n  }\r\n\r\n  return (\r\n    <section>\r\n        <div className=\"fixed top-0 left-0 w-full h-full bg-black bg-opacity-50\"></div>\r\n        <div id=\"authentication-modal\" tabIndex=\"-1\" className=\"mt-5 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full justify-center items-center flex\" aria-modal=\"true\" role=\"dialog\" >\r\n            <div className=\"relative p-4 w-full max-w-md h-full md:h-auto overflow-y-auto\">\r\n                <div className=\"relative bg-white rounded-lg shadow dark:bg-gray-700\">\r\n                <button onClick={() => setCheckout(false)} type=\"button\" className=\"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white\" data-modal-toggle=\"authentication-modal\" >\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" >\r\n                    <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path>\r\n                    </svg>\r\n                    <span className=\"sr-only\">Close modal</span>\r\n                </button>\r\n                <div className=\"py-6 px-6 lg:px-8\">\r\n                    <h3 className=\"mb-4 text-xl font-medium text-gray-900 dark:text-white\">\r\n                    <i className=\"bi bi-credit-card mr-2\"></i>CARD PAYMENT\r\n                    </h3>\r\n                    <form onSubmit={handleOrderSubmit} className=\"space-y-6\" >\r\n                        <div>\r\n                            <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Name:</label>\r\n                            <input type=\"text\" name=\"name\" id=\"name\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.name || \"Undefined\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Email:</label>\r\n                            <input type=\"text\" name=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value={user.email || \"backup@example.com\"} disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"card\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Card Number:</label>\r\n                            <input type=\"number\" name=\"card\" id=\"card\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"4215625462597845\" disabled required=\"\" />\r\n                        </div>\r\n                        <div className=\"\">\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Expiry Date:</label>\r\n                            <input type=\"number\" name=\"month\" id=\"month\" className=\"inline-block w-20 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"03\" disabled required=\"\" />\r\n                            <input type=\"number\" name=\"year\" id=\"year\" className=\"inline-block w-20 ml-3 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"27\" disabled required=\"\" />\r\n                        </div>\r\n                        <div>\r\n                            <label htmlFor=\"code\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\" >Security Code:</label>\r\n                            <input type=\"number\" name=\"code\" id=\"code\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:value-gray-400 dark:text-white\" value=\"523\" disabled required=\"\" />\r\n                        </div>\r\n                        <p className=\"mb-4 text-2xl font-semibold text-lime-500 text-center\">\r\n                            ${total}\r\n                        </p>\r\n                        <button type=\"submit\" className=\"w-full text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700\" >\r\n                            <i className=\"mr-2 bi bi-lock-fill\"></i>PAY NOW\r\n                        </button>\r\n                    </form>\r\n                </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Dashboard/DashboardPage.js",
    "content": "import { useState, useEffect } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { getUserOrders } from \"../../services\";\r\nimport { DashboardCard } from \"./components/DashboardCard\";\r\nimport { DashboardEmpty } from \"./components/DashboardEmpty\";\r\n\r\nexport const DashboardPage = () => {\r\n  const [orders, setOrders] = useState([]);\r\n  useTitle(\"Dashboard\");\r\n\r\n  useEffect(() => {\r\n    async function fetchOrders(){\r\n      try{\r\n        const data = await getUserOrders();\r\n        setOrders(data);\r\n      } catch(error){\r\n        toast.error(error.message, { closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchOrders();\r\n  }, []);\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">My Dashboard</p>\r\n      </section>\r\n\r\n      <section>\r\n        { orders.length && orders.map((order) => (\r\n          <DashboardCard key={order.id} order={order} />\r\n        )) }\r\n      </section>\r\n\r\n      <section>\r\n        { !orders.length && <DashboardEmpty /> }\r\n      </section>\r\n\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Dashboard/components/DashboardCard.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const DashboardCard = ({order}) => {\r\n  return (\r\n    <div className=\"max-w-4xl m-auto p-2 mb-5 border dark:border-slate-700\">\r\n        <div className=\"flex justify-between text-sm m-2 font-bold dark:text-slate-200\">\r\n            <span>Order Id: {order.id}</span>\r\n            <span>Total: ${order.amount_paid}</span>\r\n        </div>\r\n        { order.cartList.map((product) => (\r\n            <div key={product.id} className=\"flex flex-wrap justify-between max-w-4xl m-auto p-2 my-5 \">\r\n                <div className=\"flex\">\r\n                    <Link to={`/products/${product.id}`}>\r\n                        <img className=\"w-32 rounded\" src={product.poster} alt={product.name} />\r\n                    </Link>\r\n                    <div className=\"\">\r\n                        <Link to={`/products/${product.id}`}>\r\n                            <p className=\"text-lg ml-2 dark:text-slate-200\">{product.name}</p>\r\n                        </Link>\r\n                        <div className=\"text-lg m-2 dark:text-slate-200\">\r\n                            <span>${product.price}</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        )) }\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Dashboard/components/DashboardEmpty.js",
    "content": "export const DashboardEmpty = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-cart text-green-600 text-7xl mb-5\"></p>\r\n            <p>Oops! Your order dashboard looks empty!</p>\r\n            <p>Add eBooks to your cart from our store collection.</p>\r\n        </div>\r\n        <a href=\"/\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></a>\r\n    </section>  \r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Home/HomePage.js",
    "content": "import { useTitle } from \"../../hooks/useTitle\";\r\nimport { Hero } from \"./components/Hero\";\r\nimport { FeaturedProducts } from \"./components/FeaturedProducts\";\r\nimport { Testimonials } from \"./components/Testimonials\";\r\nimport { Faq } from \"./components/Faq\";\r\n\r\nexport const HomePage = () => {\r\n  useTitle(\"Access Latest Computer Science eBooks\");\r\n\r\n  return (\r\n    <main>\r\n        <Hero />\r\n        <FeaturedProducts />\r\n        <Testimonials />\r\n        <Faq />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Home/components/Accordion.js",
    "content": "import { useState } from \"react\";\r\n\r\nexport const Accordion = ({faq}) => {\r\n    const {question, answer} = faq;\r\n    const [show, setShow] = useState(false);\r\n\r\n    return (\r\n        <div>\r\n            <h2 id=\"accordion-flush-heading-1\">\r\n                <button onClick={() => setShow(!show)} type=\"button\" className=\"text-lg flex items-center justify-between w-full py-5 font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400\" data-accordion-target=\"#accordion-flush-body-1\" aria-expanded=\"true\" aria-controls=\"accordion-flush-body-1\">\r\n                    <span className=\"text-xl text-slate-900 dark:text-white\">{question}</span>\r\n                    { !show && <svg data-accordion-icon className=\"w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> }\r\n                    { show && <svg data-accordion-icon className=\"rotate-180 w-6 h-6 shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg> } \r\n                </button>\r\n            </h2>     \r\n            { show && (\r\n                <div id=\"accordion-flush-body-1\" className=\"\" aria-labelledby=\"accordion-flush-heading-1\">\r\n                    <div className=\"py-5 border-b border-gray-200 dark:border-gray-700\">\r\n                        <p className=\"text-lg mb-2 text-gray-500 dark:text-gray-400\">{answer}</p>\r\n                    </div>\r\n                </div> \r\n            ) }                           \r\n        </div>\r\n    )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Home/components/Faq.js",
    "content": "import { Accordion } from \"./Accordion\";\r\n\r\nexport const Faq = () => {\r\n    const faqs = [\r\n        {\r\n          \"id\": 1,\r\n          \"question\": \"Why should I use CodeBook?\",\r\n          \"answer\": \"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Repellendus earum dicta nesciunt, nulla alias consequuntur cumque incidunt saepe mollitia esse! Magni praesentium delectus excepturi nostrum illo repellendus cum eius neque, aperiam dolores quaerat quis dolore magnam doloremque minus sint nemo qui necessitatibus at. Perspiciatis, corrupti cum labore quos odio porro!\"\r\n        },\r\n        {\r\n          \"id\": 2,\r\n          \"question\": \"Can I access my eBook on mobile?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. At accusamus nobis tempore perferendis qui, quam, atque reprehenderit vero quaerat, assumenda pariatur eveniet. Maxime eaque, neque corrupti ad minus repudiandae consectetur!\"\r\n        },\r\n        {\r\n          \"id\": 3,\r\n          \"question\": \"Do you offer refunds?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        },\r\n        {\r\n          \"id\": 4,\r\n          \"question\": \"Do you support Internation payments?\",\r\n          \"answer\": \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse iste dolor deserunt expedita quam fugit et inventore amet pariatur. Animi.\"\r\n        }\r\n    ];\r\n    \r\n  return (\r\n    <section className=\"my-10 p-7 border rounded dark:border-slate-700 shadow-sm\">        \r\n      <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-3 underline underline-offset-8\">Question in mind?</h1>    \r\n            <div className=\"\" id=\"accordion-flush\" data-accordion=\"collapse\" data-active-classes=\"bg-white dark:bg-gray-900 text-gray-900 dark:text-white\" data-inactive-classes=\"text-gray-500 dark:text-gray-400\">\r\n              { faqs.map((faq) => (\r\n                <Accordion key={faq.id} faq={faq} /> \r\n              )) }\r\n            </div>\r\n      </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Home/components/FeaturedProducts.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport { ProductCard } from \"../../../components\";\r\nimport { getFeaturedList } from \"../../../services\";\r\n\r\nexport const FeaturedProducts = () => {\r\n  const [products, setProducts] = useState([]);\r\n\r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getFeaturedList();\r\n        setProducts(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [])\r\n\r\n  return (\r\n    <section className=\"my-20\">\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Featured eBooks</h1>    \r\n        <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n\r\n          { products.map((product) => (\r\n            <ProductCard key={product.id} product={product} />\r\n          )) }\r\n\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Home/components/Hero.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Hero = () => {\r\n  return (\r\n    <section className=\"flex flex-col lg:flex-row dark:text-slate-100 items-center\">\r\n        <div className=\"text my-5\">\r\n            <h1 className=\"text-5xl font-bold\">The Ultimate eBook Store</h1>\r\n            <p className=\"text-2xl my-7 px-1 dark:text-slate-300\">CodeBook is the world's most popular and authoritative source for computer science ebooks. Find ratings and access to the newest books digitally.</p>\r\n            <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-base px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800\">Explore eBooks</Link>\r\n        </div>\r\n        <div className=\"visual my-5 lg:max-w-xl\">\r\n            <img className=\"rounded-lg max-h-full\" src=\"https://images.unsplash.com/photo-1554415707-6e8cfc93fe23?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=60\" alt=\"CodeBook Hero Section\" />\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Home/components/Testimonials.js",
    "content": "export const Testimonials = () => {\r\n  return (\r\n    <section className='my-20'>\r\n        <h1 className=\"text-2xl text-center font-semibold dark:text-slate-100 mb-5 underline underline-offset-8\">Student About CodeBook</h1>    \r\n        <div className=\"grid mb-8 rounded-lg border border-gray-200 shadow-sm dark:border-gray-700 md:mb-12 md:grid-cols-2\">\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-t-lg border-b border-gray-200 md:rounded-t-none md:rounded-tl-lg md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Very easy this was to integrate</h3>\r\n                    <p className=\"my-4 font-light\">If you care for your time, I hands down would go with this.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Bonnie Green</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Developer at Random AI</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-tr-lg border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Solid foundation for any project</h3>\r\n                    <p className=\"my-4 font-light\">Designing with Figma components that can be easily translated to the utility classes of Tailwind CSS is a huge timesaver!\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1525085475165-c6808cdb005e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=50\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Roberta Casas</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Lead designer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-bl-lg border-b border-gray-200 md:border-b-0 md:border-r dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Mindblowing workflow</h3>\r\n                    <p className=\"my-4 font-light\">Aesthetically, the well designed components are beautiful and will undoubtedly level up your next application.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Jese Leos</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">Software Engineer at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n            <figure className=\"flex flex-col justify-center items-center p-8 text-center bg-white rounded-b-lg border-gray-200 md:rounded-br-lg dark:bg-gray-800 dark:border-gray-700\">\r\n                <blockquote className=\"mx-auto mb-4 max-w-2xl text-gray-500 lg:mb-8 dark:text-gray-400\">\r\n                    <h3 className=\"text-lg font-semibold text-gray-900 dark:text-white\">Efficient Collaborating</h3>\r\n                    <p className=\"my-4 font-light\">You have many examples that can be used to create a fast prototype for your team.\"</p>\r\n                </blockquote>\r\n                <figcaption className=\"flex justify-center items-center space-x-3\">\r\n                    <img className=\"w-9 h-9 rounded-full\" src=\"https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=120&q=60\" alt=\"user\" />\r\n                    <div className=\"space-y-0.5 font-medium dark:text-white text-left\">\r\n                        <div>Joseph McFall</div>\r\n                        <div className=\"text-sm font-light text-gray-500 dark:text-gray-400\">CTO at Random</div>\r\n                    </div>\r\n                </figcaption>    \r\n            </figure>\r\n        </div>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Login.js",
    "content": "import { useRef } from \"react\";\r\nimport { useNavigate } from \"react-router-dom\";\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { login } from \"../services\";\r\n\r\nexport const Login = () => {\r\n  useTitle(\"Login\");\r\n  const navigate = useNavigate();\r\n  const email = useRef();\r\n  const password = useRef();\r\n\r\n  async function handleLogin(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        email: email.current.value,\r\n        password: password.current.value\r\n      }\r\n      const data = await login(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n  \r\n  async function handleLoginGuest(){\r\n    email.current.value = process.env.REACT_APP_GUEST_LOGIN;\r\n    password.current.value = process.env.REACT_APP_GUEST_PASSWORD;\r\n    try{\r\n      const authDetail = {\r\n        email: email.current.value,\r\n        password: password.current.value\r\n      }\r\n      const data = await login(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Login</p>\r\n      </section>        \r\n        <form onSubmit={handleLogin}>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input ref={email} type=\"email\" id=\"email\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input ref={password} type=\"password\" id=\"password\" className=\"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500\" required />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Log In</button>\r\n        </form>\r\n        <button onClick={handleLoginGuest} className=\"mt-3 cursor-pointer text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-3 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Login As Guest</button>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Order/OrderPage.js",
    "content": "import { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\nimport { OrderSuccess } from \"./components/OrderSuccess\";\r\nimport { OrderFail } from \"./components/OrderFail\";\r\n\r\nexport const OrderPage = () => {\r\n  useTitle(\"Order Summary\");\r\n  const { state } = useLocation();\r\n\r\n  return (\r\n    <main>\r\n      { state.status ? <OrderSuccess data={state.data} /> : <OrderFail /> }\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Order/components/OrderFail.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderFail = () => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-exclamation-circle text-red-500 text-7xl mb-5\"></p>\r\n            <p>Payment failed, please try again!</p>     \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is not confirmed.</p>\r\n            <p>Connect <span className=\"\">codebook@example.com</span> for support.</p>\r\n        </div>\r\n        <Link to=\"/cart\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Check Cart Again<i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Order/components/OrderSuccess.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const OrderSuccess = ({data}) => {\r\n  return (\r\n    <section className=\"text-xl text-center max-w-4xl mx-auto my-10 py-5 dark:text-slate-100 border dark:border-slate-700 rounded\">\r\n        <div className=\"my-5\">\r\n            <p className=\"bi bi-check-circle text-green-600 text-7xl mb-5\"></p>\r\n            <p>Thank you {data.user.name} for the order!</p>\r\n            <p>Your Order ID: {data.id}</p>          \r\n        </div>\r\n        <div className=\"my-5\">\r\n            <p>Your order is confirmed.</p>\r\n            <p>Please check your mail ({data.user.email}) for the eBook.</p>\r\n            <p className=\"my-5\">Payment ID: xyz_123456789</p>\r\n        </div>\r\n        <Link to=\"/products\" type=\"button\" className=\"text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-lg px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none\">Continue Shopping <i className=\"ml-2 bi bi-cart\"></i></Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport Logo from \"../assets/logo.png\";\r\n\r\nexport const PageNotFound = () => {\r\n    useTitle(\"Page Not Found\");\r\n    \r\n  return (\r\n    <main>\r\n        <section className=\"flex flex-col justify-center px-2\">\r\n            <div className=\"flex flex-col items-center my-4\">\r\n                <p className=\"text-7xl text-gray-700 font-bold my-10 dark:text-white text-center\">404, Oops!</p>\r\n                <div className=\"max-w-xs\">\r\n                    <img className=\"\" src={Logo} alt=\"CodeBook Page Not Found\" />\r\n                </div>\r\n            </div>\r\n            <div className=\"flex justify-center my-4\">\r\n                <Link to=\"/\">\r\n                    <button type=\"button\" className=\"w-64 text-2xl text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br font-medium rounded-lg px-5 py-2.5 text-center mr-2 mb-2\">Back To Home</button>\r\n                </Link>\r\n            </div>\r\n        </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/ProductDetail.js",
    "content": "import { useEffect, useState } from \"react\"\r\nimport { useParams } from \"react-router-dom\";\r\nimport { toast } from \"react-toastify\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { Rating } from \"../components\";\r\nimport { useCart } from \"../context\";\r\nimport { getProduct } from \"../services\";\r\n\r\nexport const ProductDetail = () => {\r\n  const { cartList, addToCart, removeFromCart } = useCart();\r\n  const [inCart, setInCart] = useState(false);\r\n  const [product, setProduct] = useState({});\r\n  const { id } = useParams();\r\n  useTitle(product.name);\r\n  \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProduct(id);\r\n        setProduct(data);\r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }      \r\n    }\r\n    fetchProducts();\r\n  }, [id]);\r\n\r\n  useEffect(() => {\r\n    const productInCart = cartList.find(item => item.id === product.id);\r\n\r\n    if(productInCart){\r\n        setInCart(true);\r\n    } else {\r\n        setInCart(false);\r\n    }\r\n\r\n  }, [cartList, product.id]);\r\n\r\n  return (\r\n    <main>\r\n        <section>\r\n          <h1 className=\"mt-10 mb-5 text-4xl text-center font-bold text-gray-900 dark:text-slate-200\">{product.name}</h1>\r\n          <p className=\"mb-5 text-lg text-center text-gray-900 dark:text-slate-200\">{product.overview}</p>\r\n          <div className=\"flex flex-wrap justify-around\">\r\n            <div className=\"max-w-xl my-3\">\r\n              <img className=\"rounded\" src={product.poster} alt={product.name} />\r\n            </div>\r\n            <div className=\"max-w-xl my-3\">\r\n              <p className=\"text-3xl font-bold text-gray-900 dark:text-slate-200\">\r\n                <span className=\"mr-1\">$</span>\r\n                <span className=\"\">{product.price}</span>\r\n              </p>\r\n              <p className=\"my-3\"> \r\n                <span>\r\n                  <Rating rating={product.rating} />\r\n                </span>\r\n              </p>\r\n              <p className=\"my-4 select-none\">\r\n                { product.best_seller && <span className=\"font-semibold text-amber-500 border bg-amber-50 rounded-lg px-3 py-1 mr-2\">BEST SELLER</span> }\r\n                { product.in_stock && <span className=\"font-semibold text-emerald-600\tborder bg-slate-100 rounded-lg px-3 py-1 mr-2\">INSTOCK</span> }\r\n                { !product.in_stock && <span className=\"font-semibold text-rose-700 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">OUT OF STOCK</span> }\r\n                <span className=\"font-semibold text-blue-500 border bg-slate-100 rounded-lg px-3 py-1 mr-2\">{product.size} MB</span>\r\n              </p>\r\n              <p className=\"my-3\">\r\n                { !inCart && <button onClick={() => addToCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`} disabled={ product.in_stock ? \"\" : \"disabled\" }>Add To Cart <i className=\"ml-1 bi bi-plus-lg\"></i></button> } \r\n                { inCart && <button onClick={() => removeFromCart(product)} className={`inline-flex items-center py-2 px-5 text-lg font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-800 ${product.in_stock ? \"\" : \"cursor-not-allowed\"}`}  disabled={ product.in_stock ? \"\" : \"disabled\" }>Remove Item <i className=\"ml-1 bi bi-trash3\"></i></button> }  \r\n              </p>\r\n              <p className=\"text-lg text-gray-900 dark:text-slate-200\">\r\n                {product.long_description}\r\n              </p>\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Products/ProductsList.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useTitle } from \"../../hooks/useTitle\";\r\n\r\nimport { ProductCard } from \"../../components\";\r\nimport { FilterBar } from \"./components/FilterBar\";\r\n\r\nimport { useFilter } from \"../../context\";\r\nimport { getProductList } from \"../../services\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport const ProductsList = () => {\r\n  const { products, initialProductList } = useFilter();\r\n  const [show, setShow] = useState(false);\r\n  const search = useLocation().search;\r\n  const searchTerm = new URLSearchParams(search).get(\"q\");\r\n  useTitle(\"Explore eBooks Collection\");\r\n \r\n  useEffect(() => {\r\n    async function fetchProducts(){\r\n      try{\r\n        const data = await getProductList(searchTerm);\r\n        initialProductList(data); \r\n      } catch(error){\r\n        toast.error(error.message, {closeButton: true, position: \"bottom-center\" });\r\n      }\r\n    }\r\n    fetchProducts();\r\n  }, [searchTerm]); //eslint-disable-line\r\n\r\n  return (\r\n    <main>\r\n        <section className=\"my-5\">\r\n          <div className=\"my-5 flex justify-between\">\r\n            <span className=\"text-2xl font-semibold dark:text-slate-100 mb-5\">All eBooks ({products.length})</span>\r\n            <span>\r\n              <button onClick={() => setShow(!show)} id=\"dropdownMenuIconButton\" data-dropdown-toggle=\"dropdownDots\" className=\"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 rounded-lg hover:bg-gray-200 dark:text-white dark:bg-gray-600 dark:hover:bg-gray-700\" type=\"button\"> \r\n                <svg className=\"w-6 h-6\" aria-hidden=\"true\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z\"></path></svg>\r\n              </button>\r\n            </span>            \r\n          </div>    \r\n\r\n          <div className=\"flex flex-wrap justify-center lg:flex-row\">\r\n            { products.map((product) => (\r\n              <ProductCard key={product.id} product={product} />\r\n            )) }            \r\n          </div>  \r\n        </section>\r\n\r\n        { show && <FilterBar setShow={setShow} /> }\r\n\r\n    </main> \r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Products/components/FilterBar.js",
    "content": "import { useFilter } from \"../../../context\";\r\n\r\nexport const FilterBar = ({setShow}) => {\r\n  const {state, dispatch} = useFilter();\r\n\r\n  return (\r\n    <section className=\"filter\">\r\n        <div id=\"drawer-disable-body-scrolling\" className={`fixed z-40 h-screen p-5 overflow-y-auto bg-white w-72 dark:bg-gray-800 transition-transhtmlForm left-0 top-0 transhtmlForm-none`} tabIndex=\"-1\" aria-labelledby=\"drawer-disable-body-scrolling-label\" aria-modal=\"true\" role=\"dialog\">\r\n                <h5 id=\"drawer-disable-body-scrolling-label\" className=\"text-base font-semibold text-gray-500 uppercase dark:text-gray-400\">Filters</h5>\r\n                <button onClick={() => setShow(false)} type=\"button\" data-drawer-dismiss=\"drawer-disable-body-scrolling\" aria-controls=\"drawer-disable-body-scrolling\" className=\"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white\">\r\n                    <svg aria-hidden=\"true\" className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\"></path></svg>\r\n                    <span className=\"sr-only\">Close Filters</span>\r\n                </button>\r\n                <div className=\"border-b pb-3\"></div>\r\n            <div className=\"py-4 overflow-y-auto\">\r\n                <ul className=\"text-slate-700 dark:text-slate-100\">\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <p className=\"font-semibold my-1\">Sort by</p>                      \r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"lowtohigh\"}})} checked={state.sortBy === \"lowtohigh\" || false} id=\"price-sort-1\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - Low to High</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"SORT_BY\", payload: {sortBy: \"hightolow\"}})} checked={state.sortBy === \"hightolow\" || false} id=\"price-sort-2\" type=\"radio\" value=\"\" name=\"price-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"price-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Price - High to Low</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Rating</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"4STARSABOVE\"}})} checked={state.ratings === \"4STARSABOVE\" || false} id=\"rating-sort-1\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-1\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">4 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"3STARSABOVE\"}})} checked={state.ratings === \"3STARSABOVE\" || false} id=\"rating-sort-2\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-2\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">3 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"2STARSABOVE\"}})} checked={state.ratings === \"2STARSABOVE\" || false} id=\"rating-sort-3\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-3\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">2 Stars & Above</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"RATINGS\", payload: {ratings: \"1STARSABOVE\"}})} checked={state.ratings === \"1STARSABOVE\" || false} id=\"rating-sort-4\" type=\"radio\" value=\"\" name=\"rating-sort\" className=\"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"rating-sort-4\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">1 Stars & Above</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5\">\r\n                    <span className=\"font-semibold\">Other Filters</span>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"BEST_SELLER_ONLY\", payload: {bestSellerOnly: !state.bestSellerOnly}})} checked={state.bestSellerOnly || false} id=\"best-seller\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"best-seller\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Best Seller Only</label>\r\n                    </div>\r\n                    <div className=\"flex items-center my-1\">\r\n                        <input onChange={() => dispatch({type: \"ONLY_IN_STOCK\", payload: {onlyInStock: !state.onlyInStock}})} checked={state.onlyInStock || false} id=\"only-instock\" type=\"checkbox\" value=\"\" className=\"w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 dark:bg-gray-700 dark:border-gray-600\" />\r\n                        <label htmlFor=\"only-instock\" className=\"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300\">INSTOCK Only</label>\r\n                    </div>\r\n                  </li>\r\n                  <li className=\"mt-1 mb-5 px-1\">\r\n                    <button onClick={() => dispatch({type: \"CLEAR_FILTER\"})} type=\"button\" className=\"text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-10 py-2.5 mr-2 mb-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700\">Clear Filter</button>\r\n                  </li>\r\n                </ul>\r\n            </div>\r\n        </div>                   \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/Register.js",
    "content": "import { useNavigate } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { register } from '../services';\r\n\r\nexport const Register = () => {\r\n  useTitle(\"Register\");\r\n  const navigate = useNavigate();\r\n\r\n  async function handleRegister(event){\r\n    event.preventDefault();\r\n    try{\r\n      const authDetail = {\r\n        name: event.target.name.value,\r\n        email: event.target.email.value,\r\n        password: event.target.password.value\r\n      }\r\n      const data = await register(authDetail);\r\n      data.accessToken ? navigate(\"/products\") : toast.error(data);\r\n    } catch(error){\r\n      toast.error(error.message, {closeButton: true, position: \"bottom-center\"});\r\n    }\r\n  }\r\n\r\n  return (\r\n    <main>\r\n      <section>\r\n        <p className=\"text-2xl text-center font-semibold dark:text-slate-100 my-10 underline underline-offset-8\">Register</p>\r\n      </section>\r\n        <form onSubmit={handleRegister}>\r\n        <div className=\"mb-6\">\r\n              <label htmlFor=\"name\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your name</label>\r\n              <input type=\"name\" id=\"name\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"Shubham Sarda\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"email\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your email</label>\r\n              <input type=\"email\" id=\"email\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" placeholder=\"shubham@example.com\" required autoComplete=\"off\" />\r\n          </div>\r\n          <div className=\"mb-6\">\r\n              <label htmlFor=\"password\" className=\"block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300\">Your password</label>\r\n              <input type=\"password\" id=\"password\" className=\"shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 dark:shadow-sm-light\" required minLength=\"7\" />\r\n          </div>\r\n          <button type=\"submit\" className=\"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800\">Register</button>\r\n        </form>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/pages/index.js",
    "content": "export { HomePage } from \"./Home/HomePage\";\r\nexport { ProductsList } from \"./Products/ProductsList\";\r\nexport { ProductDetail } from \"./ProductDetail\";\r\n\r\nexport { CartPage } from \"./Cart/CartPage\";\r\nexport { OrderPage } from \"./Order/OrderPage\";\r\nexport { DashboardPage } from \"./Dashboard/DashboardPage\";\r\n\r\nexport { Login } from \"./Login\";\r\nexport { Register } from \"./Register\";\r\n\r\nexport { PageNotFound } from \"./PageNotFound\";\r\n"
  },
  {
    "path": "147/src/reducers/cartReducers.js",
    "content": "export const cartReducer = (state, action) => {\r\n    const { type, payload } = action;\r\n\r\n    switch(type){\r\n\r\n        case \"ADD_TO_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"REMOVE_FROM_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n        \r\n        case \"CLEAR_CART\":\r\n            return {...state, cartList: payload.products, total: payload.total}\r\n\r\n        default:\r\n            throw new Error(\"No case found!\");\r\n    }\r\n}"
  },
  {
    "path": "147/src/reducers/filterReducers.js",
    "content": "export const filterReducer = (state, action) => {\r\n    const {type, payload} = action;\r\n\r\n    switch(type){\r\n\r\n        case \"PRODUCT_LIST\":\r\n            return { productList: payload.products }\r\n        \r\n        case \"SORT_BY\":\r\n            return {...state, sortBy: payload.sortBy}\r\n        \r\n        case \"RATINGS\":\r\n            return {...state, ratings: payload.ratings}\r\n        \r\n        case \"BEST_SELLER_ONLY\":\r\n            return {...state, bestSellerOnly: payload.bestSellerOnly}\r\n        \r\n        case \"ONLY_IN_STOCK\":\r\n            return {...state, onlyInStock: payload.onlyInStock}\r\n\r\n        case \"CLEAR_FILTER\":\r\n            return {\r\n                ...state, \r\n                onlyInStock: false,\r\n                bestSellerOnly: false,\r\n                sortBy: null,\r\n                ratings: null\r\n            }\r\n        \r\n        default:\r\n            throw new Error(\"No Cae Found!\");\r\n    }\r\n}"
  },
  {
    "path": "147/src/reducers/index.js",
    "content": "export { filterReducer } from \"./filterReducers\";\r\nexport { cartReducer } from \"./cartReducers\";"
  },
  {
    "path": "147/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, ProductsList, ProductDetail, Login, Register, CartPage, OrderPage, DashboardPage, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoute } from \"./ProtectedRoute\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <>\r\n    <Routes>\r\n        <Route path=\"/\" element={<HomePage />} />\r\n        <Route path=\"products\" element={<ProductsList />} />\r\n        <Route path=\"products/:id\" element={<ProductDetail />} />\r\n\r\n        <Route path=\"login\" element={<Login />} />\r\n        <Route path=\"register\" element={<Register />} />\r\n\r\n        <Route path=\"cart\" element={<ProtectedRoute><CartPage /></ProtectedRoute>} />\r\n        <Route path=\"order-summary\" element={<ProtectedRoute><OrderPage /></ProtectedRoute>} />\r\n        <Route path=\"dashboard\" element={<ProtectedRoute><DashboardPage /></ProtectedRoute>} />\r\n\r\n        <Route path=\"*\" element={<PageNotFound />} />\r\n    </Routes>\r\n    </>\r\n  )\r\n}\r\n"
  },
  {
    "path": "147/src/routes/ProtectedRoute.js",
    "content": "import { Navigate } from \"react-router-dom\";\r\n\r\nexport const ProtectedRoute = ({children}) => {\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n\r\n  return token ? children : <Navigate to=\"/login\" />\r\n}\r\n"
  },
  {
    "path": "147/src/services/authService.js",
    "content": "export async function login(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/login`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n\r\n    if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport async function register(authDetail){\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: {\"content-Type\": \"application/json\"},\r\n        body: JSON.stringify(authDetail)\r\n    }  \r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/register`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    \r\n    if(data.accessToken){\r\n        sessionStorage.setItem(\"token\", JSON.stringify(data.accessToken));\r\n        sessionStorage.setItem(\"cbid\", JSON.stringify(data.user.id));\r\n    }\r\n\r\n    return data;\r\n}\r\n\r\nexport function logout(){\r\n    sessionStorage.removeItem(\"token\");\r\n    sessionStorage.removeItem(\"cbid\");\r\n}"
  },
  {
    "path": "147/src/services/dataService.js",
    "content": "function getSession(){\r\n    const token = JSON.parse(sessionStorage.getItem(\"token\"));\r\n    const cbid = JSON.parse(sessionStorage.getItem(\"cbid\"));\r\n    return {token, cbid};\r\n}\r\n\r\nexport async function getUser(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/600/users/${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function getUserOrders(){\r\n    const browserData = getSession();\r\n    const requestOptions = {\r\n        method: \"GET\",\r\n        headers: {\"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}`}\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/660/orders?user.id=${browserData.cbid}`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}\r\n\r\nexport async function createOrder(cartList, total, user){\r\n    const browserData = getSession();\r\n    const order = {\r\n        cartList: cartList,\r\n        amount_paid: total,\r\n        quantity: cartList.length,\r\n        user: {\r\n            name: user.name,\r\n            email: user.email,\r\n            id: user.id\r\n        }\r\n    }\r\n    const requestOptions = {\r\n        method: \"POST\",\r\n        headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${browserData.token}` },\r\n        body: JSON.stringify(order)\r\n    }\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/660/orders`, requestOptions);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json();\r\n    return data;\r\n}"
  },
  {
    "path": "147/src/services/index.js",
    "content": "export { login, register, logout } from \"./authService\";\r\nexport { getUser, getUserOrders, createOrder } from \"./dataService\";\r\nexport { getProductList, getProduct, getFeaturedList } from \"./productService\";"
  },
  {
    "path": "147/src/services/productService.js",
    "content": "export async function getProductList(searchTerm){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/products?name_like=${searchTerm ? searchTerm : \"\"}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getProduct(id){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/products/${id}`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}\r\n\r\nexport async function getFeaturedList(){\r\n    const response = await fetch(`${process.env.REACT_APP_HOST}/444/featured_products`);\r\n    if(!response.ok){\r\n        throw { message: response.statusText, status: response.status }; //eslint-disable-line\r\n    }\r\n    const data = await response.json()\r\n    return data;\r\n}"
  },
  {
    "path": "147/tailwind.config.js",
    "content": "module.exports = {\n  content: [\"./src/**/*.{html,js}\"],\n  darkMode: 'class',\n  theme: {\n    extend: {\n      colors: {\n        dark: \"#1E293B\",\n      }\n    },\n  },\n  plugins: [],\n}"
  },
  {
    "path": "148/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "148/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "148/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "148/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "148/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "148/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "148/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "148/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "148/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "148/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "148/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "148/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "148/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "148/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "148/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "148/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "149/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "149/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "149/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "149/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "149/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "149/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "149/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "149/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "149/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "149/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "149/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "149/src/components/__test__/Counter.test.js",
    "content": ""
  },
  {
    "path": "149/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "149/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "149/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "149/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "149/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "149/src/pages/__test__/PageNotFound.test.js",
    "content": ""
  },
  {
    "path": "151/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "151/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "151/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "151/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "151/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "151/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "151/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "151/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "151/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "151/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "151/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "151/src/components/__test__/Counter.test.js",
    "content": "import { render } from \"@testing-library/react\";\r\nimport { Counter } from \"../Counter\";\r\n\r\ntest(\"render the textarea\", () => {\r\n    const { getByPlaceholderText } = render(<Counter />);\r\n    const textArea = getByPlaceholderText(\"Type or paste your text\");\r\n    expect(textArea).toBeTruthy();\r\n});"
  },
  {
    "path": "151/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "151/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "151/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "151/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "151/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "152/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "152/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "152/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "152/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "152/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "152/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "152/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "152/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "152/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "152/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "152/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "152/src/components/__test__/Counter.test.js",
    "content": "import { render, screen } from \"@testing-library/react\";\r\nimport '@testing-library/jest-dom';\r\nimport { Counter } from \"../Counter\";\r\n\r\ndescribe(\"Counter Component Test\", () => {\r\n\r\n    test(\"render the textarea\", () => {\r\n        const { getByPlaceholderText } = render(<Counter />);\r\n        const textArea = getByPlaceholderText(\"Type or paste your text\");\r\n        expect(textArea).toBeTruthy();\r\n    });\r\n    \r\n    test(\"render the character result\", () => {\r\n        const { getByTestId } = render(<Counter />);\r\n        const charLength = getByTestId(\"charLength\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n    });\r\n\r\n    test(\"render the word result\", () => {\r\n        render(<Counter />);\r\n        const wordLength = screen.getByText(\"Word: 0\");\r\n        expect(wordLength).toBeInTheDocument();\r\n    });\r\n\r\n});\r\n\r\n"
  },
  {
    "path": "152/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "152/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "152/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "152/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "152/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "153/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "153/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "153/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "153/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "153/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "153/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "153/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "153/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "153/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "153/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "153/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "153/src/components/__test__/Counter.test.js",
    "content": "import { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport userEvent from \"@testing-library/user-event\";\r\nimport '@testing-library/jest-dom';\r\nimport { Counter } from \"../Counter\";\r\n\r\ndescribe(\"Counter Component Test\", () => {\r\n\r\n    test(\"render the textarea\", () => {\r\n        const { getByPlaceholderText } = render(<Counter />);\r\n        const textArea = getByPlaceholderText(\"Type or paste your text\");\r\n        expect(textArea).toBeTruthy();\r\n    });\r\n    \r\n    test(\"render the character result\", () => {\r\n        const { getByTestId } = render(<Counter />);\r\n        const charLength = getByTestId(\"charLength\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n    });\r\n\r\n    test(\"render the word result\", () => {\r\n        render(<Counter />);\r\n        const wordLength = screen.getByText(\"Word: 0\");\r\n        expect(wordLength).toBeInTheDocument();\r\n    });\r\n\r\n    test(\"change textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n    });\r\n\r\n    test(\"clear textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const clearBtn = screen.getAllByTestId(\"clearBtn\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n\r\n        fireEvent.click(clearBtn[0]);\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 0\");\r\n    });\r\n\r\n});\r\n\r\n"
  },
  {
    "path": "153/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "153/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "153/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "153/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "153/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "154/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "154/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "154/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "154/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "154/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "154/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "154/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "154/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "154/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "154/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "154/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "154/src/components/__test__/Counter.test.js",
    "content": "import { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport userEvent from \"@testing-library/user-event\";\r\nimport '@testing-library/jest-dom';\r\nimport { Counter } from \"../Counter\";\r\n\r\ndescribe(\"Counter Component Test\", () => {\r\n\r\n    test(\"render the textarea\", () => {\r\n        const { getByPlaceholderText } = render(<Counter />);\r\n        const textArea = getByPlaceholderText(\"Type or paste your text\");\r\n        expect(textArea).toBeTruthy();\r\n    });\r\n    \r\n    test(\"render the character result\", () => {\r\n        const { getByTestId } = render(<Counter />);\r\n        const charLength = getByTestId(\"charLength\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n    });\r\n\r\n    test(\"render the word result\", () => {\r\n        render(<Counter />);\r\n        const wordLength = screen.getByText(\"Word: 0\");\r\n        expect(wordLength).toBeInTheDocument();\r\n    });\r\n\r\n    test(\"change textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n    });\r\n\r\n    test(\"clear textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const clearBtn = screen.getAllByTestId(\"clearBtn\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n\r\n        fireEvent.click(clearBtn[0]);\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 0\");\r\n    });\r\n\r\n});\r\n\r\n"
  },
  {
    "path": "154/src/components/__test__/Header.test.js",
    "content": "import { render, screen } from \"@testing-library/react\";\r\nimport { Header } from \"../Header\";\r\n\r\ndescribe(\"Test Header Component\", () => {\r\n\r\n    test(\"render the heading text\", () => {\r\n        render(<Header heading=\"Word Counter\" />);\r\n        const heading = screen.getByTestId(\"heading\");\r\n        expect(heading.innerHTML).toBe(\"Word Counter\");\r\n    });\r\n\r\n    test(\"render the subheading text\", () => {\r\n        render(<Header subHeading=\"Free online character and word count tool.\" />);\r\n        const subHeading = screen.getByTestId(\"subHeading\");\r\n        expect(subHeading.innerHTML).toBe(\"Free online character and word count tool.\");\r\n    });\r\n\r\n});"
  },
  {
    "path": "154/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "154/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "154/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "154/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "154/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "155/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "155/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "155/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "155/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "155/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "155/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "155/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "155/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "155/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "155/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "155/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "155/src/components/__test__/Counter.test.js",
    "content": "import { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport userEvent from \"@testing-library/user-event\";\r\nimport '@testing-library/jest-dom';\r\nimport { Counter } from \"../Counter\";\r\n\r\ndescribe(\"Counter Component Test\", () => {\r\n\r\n    test(\"render the textarea\", () => {\r\n        const { getByPlaceholderText } = render(<Counter />);\r\n        const textArea = getByPlaceholderText(\"Type or paste your text\");\r\n        expect(textArea).toBeTruthy();\r\n    });\r\n    \r\n    test(\"render the character result\", () => {\r\n        const { getByTestId } = render(<Counter />);\r\n        const charLength = getByTestId(\"charLength\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n    });\r\n\r\n    test(\"render the word result\", () => {\r\n        render(<Counter />);\r\n        const wordLength = screen.getByText(\"Word: 0\");\r\n        expect(wordLength).toBeInTheDocument();\r\n    });\r\n\r\n    test(\"change textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n    });\r\n\r\n    test(\"clear textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const clearBtn = screen.getAllByTestId(\"clearBtn\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n\r\n        fireEvent.click(clearBtn[0]);\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 0\");\r\n    });\r\n\r\n});\r\n\r\n"
  },
  {
    "path": "155/src/components/__test__/Header.test.js",
    "content": "import { render, screen } from \"@testing-library/react\";\r\nimport { Header } from \"../Header\";\r\n\r\ndescribe(\"Test Header Component\", () => {\r\n\r\n    test(\"render the heading text\", () => {\r\n        render(<Header heading=\"Word Counter\" />);\r\n        const heading = screen.getByTestId(\"heading\");\r\n        expect(heading.innerHTML).toBe(\"Word Counter\");\r\n    });\r\n\r\n    test(\"render the subheading text\", () => {\r\n        render(<Header subHeading=\"Free online character and word count tool.\" />);\r\n        const subHeading = screen.getByTestId(\"subHeading\");\r\n        expect(subHeading.innerHTML).toBe(\"Free online character and word count tool.\");\r\n    });\r\n\r\n});"
  },
  {
    "path": "155/src/components/__test__/Joke.test.js",
    "content": "import { render, screen, waitFor } from \"@testing-library/react\";\r\nimport { Joke } from \"../Joke\";\r\n\r\ndescribe('Test Joke Component', () => { \r\n\r\n    test(\"render joke text\", async () => {\r\n        const { getByTestId } = render(<Joke />);\r\n        const jokeHeadline = getByTestId(\"jokeHeadline\");\r\n        await waitFor(() => expect(jokeHeadline.innerHTML).toBeTruthy());\r\n    });\r\n\r\n });"
  },
  {
    "path": "155/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "155/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "155/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "155/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "155/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "156/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "156/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "156/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "156/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "156/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "156/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "156/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "156/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "156/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "156/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "156/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "156/src/components/__test__/Counter.test.js",
    "content": "import { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport userEvent from \"@testing-library/user-event\";\r\nimport '@testing-library/jest-dom';\r\nimport { Counter } from \"../Counter\";\r\n\r\ndescribe(\"Counter Component Test\", () => {\r\n\r\n    test(\"render the textarea\", () => {\r\n        const { getByPlaceholderText } = render(<Counter />);\r\n        const textArea = getByPlaceholderText(\"Type or paste your text\");\r\n        expect(textArea).toBeTruthy();\r\n    });\r\n    \r\n    test(\"render the character result\", () => {\r\n        const { getByTestId } = render(<Counter />);\r\n        const charLength = getByTestId(\"charLength\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n    });\r\n\r\n    test(\"render the word result\", () => {\r\n        render(<Counter />);\r\n        const wordLength = screen.getByText(\"Word: 0\");\r\n        expect(wordLength).toBeInTheDocument();\r\n    });\r\n\r\n    test(\"change textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n    });\r\n\r\n    test(\"clear textarea and update result\", () => {\r\n        render(<Counter />);\r\n        const textArea = screen.getByTestId(\"textArea\");\r\n        const clearBtn = screen.getAllByTestId(\"clearBtn\");\r\n        const charLength = screen.getByTestId(\"charLength\");\r\n        const wordLength = screen.getByTestId(\"wordLength\");\r\n\r\n        userEvent.type(textArea, \"shubham\");\r\n        expect(charLength.innerHTML).toBe(\"Character: 7\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 1\");\r\n\r\n        fireEvent.click(clearBtn[0]);\r\n        expect(charLength.innerHTML).toBe(\"Character: 0\");\r\n        expect(wordLength.innerHTML).toBe(\"Word: 0\");\r\n    });\r\n\r\n});\r\n\r\n"
  },
  {
    "path": "156/src/components/__test__/Header.test.js",
    "content": "import { render, screen } from \"@testing-library/react\";\r\nimport { Header } from \"../Header\";\r\n\r\ndescribe(\"Test Header Component\", () => {\r\n\r\n    test(\"render the heading text\", () => {\r\n        render(<Header heading=\"Word Counter\" />);\r\n        const heading = screen.getByTestId(\"heading\");\r\n        expect(heading.innerHTML).toBe(\"Word Counter\");\r\n    });\r\n\r\n    test(\"render the subheading text\", () => {\r\n        render(<Header subHeading=\"Free online character and word count tool.\" />);\r\n        const subHeading = screen.getByTestId(\"subHeading\");\r\n        expect(subHeading.innerHTML).toBe(\"Free online character and word count tool.\");\r\n    });\r\n\r\n});"
  },
  {
    "path": "156/src/components/__test__/Joke.test.js",
    "content": "import { render, screen, waitFor } from \"@testing-library/react\";\r\nimport { Joke } from \"../Joke\";\r\n\r\ndescribe('Test Joke Component', () => { \r\n\r\n    test(\"render joke text\", async () => {\r\n        const { getByTestId } = render(<Joke />);\r\n        const jokeHeadline = getByTestId(\"jokeHeadline\");\r\n        await waitFor(() => expect(jokeHeadline.innerHTML).toBeTruthy());\r\n    });\r\n\r\n });"
  },
  {
    "path": "156/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "156/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "156/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "156/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "156/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"Page Not Found\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "156/src/pages/__test__/PageNotFound.test.js",
    "content": "import { render } from \"@testing-library/react\";\r\nimport { PageNotFound } from \"../PageNotFound\";\r\nimport { BrowserRouter } from \"react-router-dom\";\r\n\r\ndescribe(\"Test PageNotFound Page\", () => {\r\n\r\n    test(\"render text and image\", () => {\r\n        const { getByTestId, getByAltText } = render(<PageNotFound />, { wrapper: BrowserRouter });\r\n        const pnfText = getByTestId(\"pnfText\");\r\n        const pnfImage = getByAltText(\"Page Not Found\");\r\n        \r\n        expect(pnfText.innerHTML).toBe(\"Oops - Page Not Found!\");\r\n        expect(pnfImage).toBeTruthy();\r\n    });\r\n\r\n});"
  },
  {
    "path": "157/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "157/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "157/netlify.toml",
    "content": "[[redirects]]\r\nfrom = \"/*\"\r\nto = \"/index.html\"\r\nstatus = 200"
  },
  {
    "path": "157/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "157/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "157/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "157/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "157/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "157/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "157/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "157/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "157/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "157/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "157/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "157/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "157/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "157/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "158/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "158/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "158/netlify.toml",
    "content": "[[redirects]]\r\nfrom = \"/*\"\r\nto = \"/index.html\"\r\nstatus = 200"
  },
  {
    "path": "158/package.json",
    "content": "{\n  \"name\": \"testing\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.3.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "158/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Word Counter - Count Words and Characters</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "158/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "158/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "158/src/App.css",
    "content": "main{\r\n    background-color: #ffffff;\r\n    min-height: 100vh;\r\n}\r\n\r\n.header{\r\n    text-align: center;\r\n    padding: 40px 0px;\r\n    color: #191919;\r\n}\r\n\r\n.header h1{\r\n    font-size: 32px;\r\n}\r\n\r\n.header p{\r\n    font-size: 18px;\r\n}\r\n\r\n.counter{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n}\r\n\r\n.counter textarea {\r\n    resize: none;\r\n    width: 90%;\r\n    height: 250px;\r\n    font-size: 18px;\r\n    padding: 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n}\r\n\r\n.counter textarea:focus {\r\n    outline: none;\r\n}\r\n\r\n\r\n.counter button{\r\n    background-color: #bc4242;\r\n    color: #ffffff;\r\n    display: block;\r\n    margin: auto;\r\n    width: 150px;\r\n    font-size: 16px;   \r\n    padding: 5px 15px;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin-top: 15px;\r\n    cursor: pointer;\r\n}\r\n\r\n.counter button:hover{\r\n    background-color: #ae3a3a;\r\n}\r\n\r\n.counter button:disabled {\r\n    background-color: #858585;\r\n    cursor: not-allowed;\r\n}\r\n\r\n.counter .result{\r\n    display: flex;\r\n    justify-content: space-between;\r\n    flex-wrap: wrap;\r\n    font-size: 22px;\r\n    margin: 10px 0px;\r\n}\r\n\r\n.counter .result span{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    min-width: 170px;\r\n    padding: 10px 15px;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n}\r\n\r\n.joke{\r\n    max-width: 900px;\r\n    margin: auto;\r\n    text-align: center;\r\n    padding: 20px 10px;\r\n}\r\n\r\n.joke p{\r\n    padding: 20px 20px;\r\n    border: 1px solid #1F4690;\r\n    border-radius: 5px;\r\n    margin: 10px;\r\n\r\n}\r\n\r\n.pnf{\r\n    padding: 50px 10px;\r\n}\r\n\r\n.pnf img{\r\n    max-width: 100%;\r\n    border-radius: 5px;\r\n    margin: 15px auto;\r\n}\r\n\r\n.oops{\r\n    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;\r\n    max-width: 350px;\r\n    border-radius: 5px;\r\n    padding: 30px 40px;\r\n    font-size: 20px;\r\n    text-align: center;\r\n    margin: auto;\r\n}\r\n\r\n\r\n.oops p{\r\n    margin: 10px;\r\n    font-size: 26px;\r\n}\r\n\r\n\r\n.oops button{\r\n    background-color: #1F4690;\r\n    color: #ffffff;\r\n    border: 0px;\r\n    border-radius: 5px;\r\n    margin: 15px;\r\n    cursor: pointer;\r\n    padding: 10px 20px;\r\n    font-size: 20px;\r\n}"
  },
  {
    "path": "158/src/App.js",
    "content": "import './App.css';\nimport { Route, Routes } from \"react-router-dom\";\nimport { HomePage } from \"./pages/HomePage\";\nimport { JokePage } from \"./pages/JokePage\";\nimport { PageNotFound } from \"./pages/PageNotFound\";\n\n\nfunction App() {\n  return (\n      <>\n        <Routes>\n            <Route path=\"/\" element={<HomePage />}></Route>\n            <Route path=\"joke\" element={<JokePage />}></Route>\n            <Route path=\"*\" element={<PageNotFound />}></Route>\n        </Routes>\n      </>\n  );\n}\n\nexport default App;"
  },
  {
    "path": "158/src/components/Counter.js",
    "content": "import { useRef, useState } from \"react\";\r\n\r\nexport const Counter = () => {\r\n    const [charLength, setCharLength] = useState(0);\r\n    const [wordLength, setWordLength] = useState(0);\r\n\r\n    const textRef = useRef();\r\n    \r\n    const handleCount = () => {\r\n      const value = textRef.current.value;\r\n      setCharLength(value.length);\r\n      value.length ? setWordLength(value.trim().split(\" \").length) : setWordLength(0);\r\n    }\r\n\r\n    const handleButton = () => {\r\n      textRef.current.value = \"\";\r\n      handleCount();\r\n    }\r\n\r\n  return (\r\n    <section className=\"counter\">\r\n        <textarea onChange={handleCount} ref={textRef} data-testid=\"textArea\" placeholder=\"Type or paste your text\"></textarea>\r\n        <button onClick={handleButton} data-testid=\"clearBtn\" disabled={charLength ? \"\" : \"disabled\"}>Clear</button>\r\n\r\n        <p className=\"result\">\r\n          <span data-testid=\"charLength\">Character: {charLength}</span>\r\n          <span data-testid=\"wordLength\">Word: {wordLength}</span>\r\n        </p>\r\n    </section>\r\n  )\r\n}"
  },
  {
    "path": "158/src/components/Header.js",
    "content": "export const Header = ({heading, subHeading}) => {\r\n  return (\r\n    <section className=\"header\">\r\n        <h1 data-testid=\"heading\">{heading}</h1>\r\n        <p data-testid=\"subHeading\">{subHeading}</p>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "158/src/components/Joke.js",
    "content": "import { useEffect, useState } from \"react\";\r\n\r\nexport const Joke = () => {\r\n    const [joke, setJoke] = useState(\"\");\r\n\r\n    useEffect(() => {\r\n        const fetchJoke = async () => {\r\n            const response = await fetch(\"https://api.chucknorris.io/jokes/random\");\r\n            const data = await response.json();\r\n            setJoke(data.value)\r\n        }\r\n        fetchJoke();\r\n    }, [])\r\n    \r\n    return (\r\n        <section className=\"joke\">\r\n            <p>\r\n                <span data-testid=\"jokeHeadline\">{joke}</span>\r\n                <span> - api.chucknorris.io</span>\r\n            </p>\r\n        </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "158/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n    margin: 0;\r\n    padding: 0;\r\n}"
  },
  {
    "path": "158/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter as Router } from \"react-router-dom\";\n\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <Router>\n      <App />\n    </Router>\n  </React.StrictMode>\n);"
  },
  {
    "path": "158/src/pages/HomePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Counter } from \"../components/Counter\";\r\n\r\nexport function HomePage() {\r\n  return (\r\n    <main>\r\n      <Header heading=\"Word Counter\" subHeading=\"Free online character and word count tool.\" />\r\n      <Counter />\r\n    </main>\r\n  );\r\n}"
  },
  {
    "path": "158/src/pages/JokePage.js",
    "content": "import { Header } from \"../components/Header\";\r\nimport { Joke } from \"../components/Joke\";\r\n\r\nexport const JokePage = () => {\r\n  return (\r\n    <main>\r\n      <Header heading=\"ChuckNorris Jokes\" subHeading=\"Free JSON API for hand curated Chuck Norris facts.\" />\r\n      <Joke />\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "158/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\"\r\nimport PageNotFoundImage  from \"../assets/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <main>\r\n      <section className=\"pnf\">\r\n        <div className=\"oops\">\r\n          <p data-testid=\"pnfText\">Oops - Page Not Found!</p>\r\n          <img src={PageNotFoundImage } alt=\"\" />\r\n          <Link to=\"/\">\r\n            <button data-testid=\"homeBtn\">Go Back To Word Counter</button>\r\n          </Link>\r\n        </div>\r\n      </section>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "159/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "159/netlify.toml",
    "content": "[[redirects]]\r\nfrom = \"/*\"\r\nto = \"/index.html\"\r\nstatus = 200"
  },
  {
    "path": "159/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"9.10\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-loading-skeleton\": \"^3.1.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "159/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "159/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "159/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "159/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "159/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "159/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport { auth, provider } from \"../firebase/config\";\r\nimport { signInWithPopup, signOut } from \"firebase/auth\";\r\nimport Logo from \"../assets/logo.png\";\r\nimport { useState } from \"react\";\r\n\r\nexport const Header = () => {\r\n  const [isAuth, setIsAuth] = useState(JSON.parse(localStorage.getItem(\"isAuth\")) || false);\r\n\r\n  function handleLogin(){\r\n    signInWithPopup(auth, provider).then((result) => {\r\n      setIsAuth(true);\r\n      localStorage.setItem(\"isAuth\", true);\r\n    })\r\n  }\r\n\r\n  function handleLogout(){\r\n    signOut(auth);\r\n    setIsAuth(false);\r\n    localStorage.setItem(\"isAuth\", false);\r\n  }\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button onClick={handleLogout} className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button onClick={handleLogin} className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/components/PostCard.js",
    "content": "import { doc, deleteDoc } from \"firebase/firestore\";\r\nimport { auth, db } from \"../firebase/config\";\r\n\r\nexport const PostCard = ({post, toggle, setToggle}) => {\r\n    const {id, title, description, author} = post;\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\"));\r\n\r\n    async function handleDelete(){\r\n      const document = doc(db, \"posts\", id);\r\n      await deleteDoc(document);\r\n      setToggle(!toggle);\r\n    }\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author.name}</span>\r\n            { isAuth && (author.id === auth.currentUser.uid) && <span onClick={handleDelete} className=\"delete\"><i className=\"bi bi-trash3\"></i></span> }\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/components/SkeletonCard.js",
    "content": "import Skeleton from 'react-loading-skeleton';\r\n\r\nexport const SkeletonCard = () => {\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{<Skeleton />}</p>\r\n        <p className=\"description\"><Skeleton count={3} /></p>\r\n        <p className=\"control\">\r\n          <Skeleton width=\"70px\" />\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";\r\nexport { SkeletonCard } from \"./SkeletonCard\";"
  },
  {
    "path": "159/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: `${process.env.REACT_APP_API_KEY}`,\r\n  authDomain: `${process.env.REACT_APP_AUTH_DOMAIN}`,\r\n  projectId: `${process.env.REACT_APP_PROJECT_ID}`,\r\n  storageBucket: `${process.env.REACT_APP_STORAGE_BUCKET}`,\r\n  messagingSenderId: `${process.env.REACT_APP_MESSAGING_SENDER_ID}`,\r\n  appId: `${process.env.REACT_APP_APP_ID}`\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "159/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - WriteNode`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "159/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "159/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport 'react-loading-skeleton/dist/skeleton.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "159/src/pages/CreatePost.js",
    "content": "import { useNavigate } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { addDoc, collection } from \"firebase/firestore\";\r\nimport { db, auth } from \"../firebase/config\";\r\n\r\nexport const CreatePost = () => {\r\n  const navigate = useNavigate();\r\n  useTitle(\"Create Post\");\r\n  const postRef = collection(db, \"posts\");\r\n\r\n  async function handleCreatePost(event){\r\n    event.preventDefault();\r\n\r\n    const document = {\r\n      title: event.target.title.value,\r\n      description: event.target.description.value,\r\n      author: {\r\n        name: auth.currentUser.displayName,\r\n        id: auth.currentUser.uid\r\n      }\r\n    }\r\n    await addDoc(postRef, document);\r\n    navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\" onSubmit={handleCreatePost}>\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/pages/HomePage.js",
    "content": "import { useEffect, useState, useRef } from \"react\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard, SkeletonCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState(new Array(2).fill(false));\r\n  const [toggle, setToggle] = useState(false);\r\n  useTitle(\"Home\");\r\n  const postsRef = useRef(collection(db, \"posts\"));\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef.current);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    getPosts();\r\n  }, [postsRef, toggle]);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post, index) => (\r\n        post ? (\r\n          <PostCard key={post.id} post={post} toggle={toggle} setToggle={setToggle} />\r\n        ) : (\r\n          <SkeletonCard key={index} />\r\n        )        \r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  useTitle(\"Page Not Found\");\r\n\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "159/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoutes } from \"./ProtectedRoutes\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <ProtectedRoutes><CreatePost /></ProtectedRoutes> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "159/src/routes/ProtectedRoutes.js",
    "content": "import { Navigate } from \"react-router-dom\"\r\n\r\nexport const ProtectedRoutes = ({children}) => {\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\") || false);\r\n    return isAuth ? children : <Navigate to=\"/\" />;\r\n}\r\n"
  },
  {
    "path": "160/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "160/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "160/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "160/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "160/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "160/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "160/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "160/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "160/src/components/Footer.js",
    "content": "export const Footer = () => {\r\n  return (\r\n    <div>Footer</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "160/src/components/Header.js",
    "content": "export const Header = () => {\r\n  return (\r\n    <div>Header</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "160/src/components/PostCard.js",
    "content": ""
  },
  {
    "path": "160/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "160/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "160/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "160/src/pages/CreatePost.js",
    "content": "export const CreatePost = () => {\r\n  return (\r\n    <div>CreatePost</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "160/src/pages/HomePage.js",
    "content": "export const HomePage = () => {\r\n  return (\r\n    <div>HomePage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "160/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <div>PageNotFound</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "160/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "160/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <CreatePost /> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "160/src/routes/ProtectedRoutes.js",
    "content": ""
  },
  {
    "path": "161/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "161/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "161/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "161/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "161/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "161/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "161/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "161/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "161/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "161/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  const isAuth = true;\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "161/src/components/PostCard.js",
    "content": ""
  },
  {
    "path": "161/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "161/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "161/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "161/src/pages/CreatePost.js",
    "content": "export const CreatePost = () => {\r\n  return (\r\n    <div>CreatePost</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "161/src/pages/HomePage.js",
    "content": "export const HomePage = () => {\r\n  return (\r\n    <div>HomePage</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "161/src/pages/PageNotFound.js",
    "content": "export const PageNotFound = () => {\r\n  return (\r\n    <div>PageNotFound</div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "161/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "161/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <CreatePost /> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "161/src/routes/ProtectedRoutes.js",
    "content": ""
  },
  {
    "path": "162/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "162/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "162/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "162/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "162/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "162/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "162/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "162/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "162/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  const isAuth = true;\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/components/PostCard.js",
    "content": "export const PostCard = ({post}) => {\r\n    const {title, description, author} = post;\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author}</span>\r\n            <span className=\"delete\"><i className=\"bi bi-trash3\"></i></span>\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "162/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "162/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "162/src/pages/CreatePost.js",
    "content": "export const CreatePost = () => {\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\">\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/pages/HomePage.js",
    "content": "import { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const posts = [\r\n    {id: 1, title: \"Lorem ipsum dolor sit amet\", description: \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat quidem magnam vitae, deserunt facilis, commodi accusamus doloribus fugiat, soluta debitis illo nostrum quo tempora consequatur quas illum nobis laboriosam recusandae distinctio nihil ratione. Minima reprehenderit maiores fugiat cupiditate dolorem, consequuntur asperiores nostrum voluptatem laboriosam temporibus obcaecati, nesciunt beatae possimus tenetur.\", author: \"Shubham\"}, \r\n    {id: 2, title: \"Lorem ipsum dolor\", description: \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat quidem magnam vitae, deserunt facilis, commodi accusamus doloribus fugiat, soluta debitis illo nostrum quo tempora consequatur quas illum nobis laboriosam recusandae distinctio nihil ratione. Minima reprehenderit maiores fugiat cupiditate dolorem, consequuntur asperiores nostrum voluptatem.\", author: \"Shubham\"}\r\n  ]\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "162/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <CreatePost /> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "162/src/routes/ProtectedRoutes.js",
    "content": ""
  },
  {
    "path": "163/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "163/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "163/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"^9.11.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "163/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "163/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "163/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "163/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "163/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "163/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  const isAuth = true;\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/components/PostCard.js",
    "content": "export const PostCard = ({post}) => {\r\n    const {title, description, author} = post;\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author}</span>\r\n            <span className=\"delete\"><i className=\"bi bi-trash3\"></i></span>\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "163/src/firebase/config.js",
    "content": "// Import the functions you need from the SDKs you need\r\nimport { initializeApp } from \"firebase/app\";\r\n// TODO: Add SDKs for Firebase products that you want to use\r\n// https://firebase.google.com/docs/web/setup#available-libraries\r\n\r\n// Your web app's Firebase configuration\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBwf-hUGb7_uKRdzEeTbNJM-t63p6bianI\",\r\n  authDomain: \"writenode.firebaseapp.com\",\r\n  projectId: \"writenode\",\r\n  storageBucket: \"writenode.appspot.com\",\r\n  messagingSenderId: \"957707337787\",\r\n  appId: \"1:957707337787:web:d69d5537207ea631fe9c1e\"\r\n};\r\n\r\n// Initialize Firebase\r\nconst app = initializeApp(firebaseConfig);"
  },
  {
    "path": "163/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "163/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "163/src/pages/CreatePost.js",
    "content": "export const CreatePost = () => {\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\">\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/pages/HomePage.js",
    "content": "import { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const posts = [\r\n    {id: 1, title: \"Lorem ipsum dolor sit amet\", description: \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat quidem magnam vitae, deserunt facilis, commodi accusamus doloribus fugiat, soluta debitis illo nostrum quo tempora consequatur quas illum nobis laboriosam recusandae distinctio nihil ratione. Minima reprehenderit maiores fugiat cupiditate dolorem, consequuntur asperiores nostrum voluptatem laboriosam temporibus obcaecati, nesciunt beatae possimus tenetur.\", author: \"Shubham\"}, \r\n    {id: 2, title: \"Lorem ipsum dolor\", description: \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat quidem magnam vitae, deserunt facilis, commodi accusamus doloribus fugiat, soluta debitis illo nostrum quo tempora consequatur quas illum nobis laboriosam recusandae distinctio nihil ratione. Minima reprehenderit maiores fugiat cupiditate dolorem, consequuntur asperiores nostrum voluptatem.\", author: \"Shubham\"}\r\n  ]\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "163/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <CreatePost /> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "163/src/routes/ProtectedRoutes.js",
    "content": ""
  },
  {
    "path": "164/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "164/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "164/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"^9.11.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "164/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "164/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "164/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "164/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "164/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "164/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\"\r\nimport Logo from \"../assets/logo.png\"\r\n\r\nexport const Header = () => {\r\n  const isAuth = true;\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/components/PostCard.js",
    "content": "export const PostCard = ({post}) => {\r\n    const {title, description, author} = post;\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author}</span>\r\n            <span className=\"delete\"><i className=\"bi bi-trash3\"></i></span>\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "164/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBwf-hUGb7_uKRdzEeTbNJM-t63p6bianI\",\r\n  authDomain: \"writenode.firebaseapp.com\",\r\n  projectId: \"writenode\",\r\n  storageBucket: \"writenode.appspot.com\",\r\n  messagingSenderId: \"957707337787\",\r\n  appId: \"1:957707337787:web:d69d5537207ea631fe9c1e\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "164/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "164/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "164/src/pages/CreatePost.js",
    "content": "export const CreatePost = () => {\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\">\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/pages/HomePage.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState([]);\r\n  const postsRef = collection(db, \"posts\");\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    console.log(\"---\");\r\n    getPosts();\r\n  }, []);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "164/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <CreatePost /> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "164/src/routes/ProtectedRoutes.js",
    "content": ""
  },
  {
    "path": "165/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "165/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "165/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"^9.11.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "165/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "165/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "165/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "165/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "165/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "165/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport { auth, provider } from \"../firebase/config\";\r\nimport { signInWithPopup, signOut } from \"firebase/auth\";\r\nimport Logo from \"../assets/logo.png\";\r\nimport { useState } from \"react\";\r\n\r\nexport const Header = () => {\r\n  const [isAuth, setIsAuth] = useState(false);\r\n\r\n  function handleLogin(){\r\n    signInWithPopup(auth, provider).then((result) => {\r\n      console.log(result);\r\n      setIsAuth(true);\r\n    })\r\n  }\r\n\r\n  function handleLogout(){\r\n    signOut(auth);\r\n    setIsAuth(false);\r\n  }\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button onClick={handleLogout} className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button onClick={handleLogin} className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/components/PostCard.js",
    "content": "export const PostCard = ({post}) => {\r\n    const {title, description, author} = post;\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author}</span>\r\n            <span className=\"delete\"><i className=\"bi bi-trash3\"></i></span>\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "165/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBwf-hUGb7_uKRdzEeTbNJM-t63p6bianI\",\r\n  authDomain: \"writenode.firebaseapp.com\",\r\n  projectId: \"writenode\",\r\n  storageBucket: \"writenode.appspot.com\",\r\n  messagingSenderId: \"957707337787\",\r\n  appId: \"1:957707337787:web:d69d5537207ea631fe9c1e\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "165/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "165/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "165/src/pages/CreatePost.js",
    "content": "export const CreatePost = () => {\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\">\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/pages/HomePage.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState([]);\r\n  const postsRef = collection(db, \"posts\");\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    console.log(\"---\");\r\n    getPosts();\r\n  }, []);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "165/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <CreatePost /> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "165/src/routes/ProtectedRoutes.js",
    "content": ""
  },
  {
    "path": "167/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "167/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "167/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"^9.11.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "167/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "167/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "167/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "167/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "167/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "167/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport { auth, provider } from \"../firebase/config\";\r\nimport { signInWithPopup, signOut } from \"firebase/auth\";\r\nimport Logo from \"../assets/logo.png\";\r\nimport { useState } from \"react\";\r\n\r\nexport const Header = () => {\r\n  const [isAuth, setIsAuth] = useState(JSON.parse(localStorage.getItem(\"isAuth\")) || false);\r\n\r\n  function handleLogin(){\r\n    signInWithPopup(auth, provider).then((result) => {\r\n      console.log(result);\r\n      setIsAuth(true);\r\n      localStorage.setItem(\"isAuth\", true);\r\n    })\r\n  }\r\n\r\n  function handleLogout(){\r\n    signOut(auth);\r\n    setIsAuth(false);\r\n    localStorage.setItem(\"isAuth\", false);\r\n  }\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button onClick={handleLogout} className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button onClick={handleLogin} className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/components/PostCard.js",
    "content": "export const PostCard = ({post}) => {\r\n    const {title, description, author} = post;\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author}</span>\r\n            <span className=\"delete\"><i className=\"bi bi-trash3\"></i></span>\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "167/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBwf-hUGb7_uKRdzEeTbNJM-t63p6bianI\",\r\n  authDomain: \"writenode.firebaseapp.com\",\r\n  projectId: \"writenode\",\r\n  storageBucket: \"writenode.appspot.com\",\r\n  messagingSenderId: \"957707337787\",\r\n  appId: \"1:957707337787:web:d69d5537207ea631fe9c1e\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "167/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "167/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "167/src/pages/CreatePost.js",
    "content": "import { addDoc, collection } from \"firebase/firestore\";\r\nimport { db, auth } from \"../firebase/config\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const CreatePost = () => {\r\n  const navigate = useNavigate();\r\n  const postRef = collection(db, \"posts\");\r\n\r\n  async function handleCreatePost(event){\r\n    event.preventDefault();\r\n\r\n    const document = {\r\n      title: event.target.title.value,\r\n      description: event.target.description.value,\r\n      author: {\r\n        name: auth.currentUser.displayName,\r\n        id: auth.currentUser.uid\r\n      }\r\n    }\r\n    await addDoc(postRef, document);\r\n    navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\" onSubmit={handleCreatePost}>\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/pages/HomePage.js",
    "content": "import { useEffect, useState } from \"react\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState([]);\r\n  const postsRef = collection(db, \"posts\");\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    console.log(\"---\");\r\n    getPosts();\r\n  }, []);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "167/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoutes } from \"./ProtectedRoutes\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <ProtectedRoutes><CreatePost /></ProtectedRoutes> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "167/src/routes/ProtectedRoutes.js",
    "content": "import { Navigate } from \"react-router-dom\"\r\n\r\nexport const ProtectedRoutes = ({children}) => {\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\") || false);\r\n    return isAuth ? children : <Navigate to=\"/\" />;\r\n}\r\n"
  },
  {
    "path": "168/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "168/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "168/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"^9.11.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "168/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "168/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "168/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "168/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "168/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "168/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport { auth, provider } from \"../firebase/config\";\r\nimport { signInWithPopup, signOut } from \"firebase/auth\";\r\nimport Logo from \"../assets/logo.png\";\r\nimport { useState } from \"react\";\r\n\r\nexport const Header = () => {\r\n  const [isAuth, setIsAuth] = useState(JSON.parse(localStorage.getItem(\"isAuth\")) || false);\r\n\r\n  function handleLogin(){\r\n    signInWithPopup(auth, provider).then((result) => {\r\n      console.log(result);\r\n      setIsAuth(true);\r\n      localStorage.setItem(\"isAuth\", true);\r\n    })\r\n  }\r\n\r\n  function handleLogout(){\r\n    signOut(auth);\r\n    setIsAuth(false);\r\n    localStorage.setItem(\"isAuth\", false);\r\n  }\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button onClick={handleLogout} className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button onClick={handleLogin} className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/components/PostCard.js",
    "content": "import { doc, deleteDoc } from \"firebase/firestore\";\r\nimport { auth, db } from \"../firebase/config\";\r\n\r\nexport const PostCard = ({post, toggle, setToggle}) => {\r\n    const {id, title, description, author} = post;\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\"));\r\n\r\n    async function handleDelete(){\r\n      const document = doc(db, \"posts\", id);\r\n      await deleteDoc(document);\r\n      setToggle(!toggle);\r\n    }\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author.name}</span>\r\n            { isAuth && (author.id === auth.currentUser.uid) && <span onClick={handleDelete} className=\"delete\"><i className=\"bi bi-trash3\"></i></span> }\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "168/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBwf-hUGb7_uKRdzEeTbNJM-t63p6bianI\",\r\n  authDomain: \"writenode.firebaseapp.com\",\r\n  projectId: \"writenode\",\r\n  storageBucket: \"writenode.appspot.com\",\r\n  messagingSenderId: \"957707337787\",\r\n  appId: \"1:957707337787:web:d69d5537207ea631fe9c1e\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "168/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "168/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "168/src/pages/CreatePost.js",
    "content": "import { addDoc, collection } from \"firebase/firestore\";\r\nimport { db, auth } from \"../firebase/config\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const CreatePost = () => {\r\n  const navigate = useNavigate();\r\n  const postRef = collection(db, \"posts\");\r\n\r\n  async function handleCreatePost(event){\r\n    event.preventDefault();\r\n\r\n    const document = {\r\n      title: event.target.title.value,\r\n      description: event.target.description.value,\r\n      author: {\r\n        name: auth.currentUser.displayName,\r\n        id: auth.currentUser.uid\r\n      }\r\n    }\r\n    await addDoc(postRef, document);\r\n    navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\" onSubmit={handleCreatePost}>\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/pages/HomePage.js",
    "content": "import { useEffect, useState, useRef } from \"react\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState([]);\r\n  const [toggle, setToggle] = useState(false);\r\n  const postsRef = useRef(collection(db, \"posts\"));\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef.current);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    getPosts();\r\n  }, [postsRef, toggle]);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} toggle={toggle} setToggle={setToggle} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "168/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoutes } from \"./ProtectedRoutes\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <ProtectedRoutes><CreatePost /></ProtectedRoutes> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "168/src/routes/ProtectedRoutes.js",
    "content": "import { Navigate } from \"react-router-dom\"\r\n\r\nexport const ProtectedRoutes = ({children}) => {\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\") || false);\r\n    return isAuth ? children : <Navigate to=\"/\" />;\r\n}\r\n"
  },
  {
    "path": "169/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "169/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "169/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"^9.11.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "169/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "169/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "169/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "169/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "169/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "169/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport { auth, provider } from \"../firebase/config\";\r\nimport { signInWithPopup, signOut } from \"firebase/auth\";\r\nimport Logo from \"../assets/logo.png\";\r\nimport { useState } from \"react\";\r\n\r\nexport const Header = () => {\r\n  const [isAuth, setIsAuth] = useState(JSON.parse(localStorage.getItem(\"isAuth\")) || false);\r\n\r\n  function handleLogin(){\r\n    signInWithPopup(auth, provider).then((result) => {\r\n      console.log(result);\r\n      setIsAuth(true);\r\n      localStorage.setItem(\"isAuth\", true);\r\n    })\r\n  }\r\n\r\n  function handleLogout(){\r\n    signOut(auth);\r\n    setIsAuth(false);\r\n    localStorage.setItem(\"isAuth\", false);\r\n  }\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button onClick={handleLogout} className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button onClick={handleLogin} className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/components/PostCard.js",
    "content": "import { doc, deleteDoc } from \"firebase/firestore\";\r\nimport { auth, db } from \"../firebase/config\";\r\n\r\nexport const PostCard = ({post, toggle, setToggle}) => {\r\n    const {id, title, description, author} = post;\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\"));\r\n\r\n    async function handleDelete(){\r\n      const document = doc(db, \"posts\", id);\r\n      await deleteDoc(document);\r\n      setToggle(!toggle);\r\n    }\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author.name}</span>\r\n            { isAuth && (author.id === auth.currentUser.uid) && <span onClick={handleDelete} className=\"delete\"><i className=\"bi bi-trash3\"></i></span> }\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";"
  },
  {
    "path": "169/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBwf-hUGb7_uKRdzEeTbNJM-t63p6bianI\",\r\n  authDomain: \"writenode.firebaseapp.com\",\r\n  projectId: \"writenode\",\r\n  storageBucket: \"writenode.appspot.com\",\r\n  messagingSenderId: \"957707337787\",\r\n  appId: \"1:957707337787:web:d69d5537207ea631fe9c1e\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "169/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "169/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "169/src/pages/CreatePost.js",
    "content": "import { addDoc, collection } from \"firebase/firestore\";\r\nimport { db, auth } from \"../firebase/config\";\r\nimport { useNavigate } from \"react-router-dom\";\r\n\r\nexport const CreatePost = () => {\r\n  const navigate = useNavigate();\r\n  const postRef = collection(db, \"posts\");\r\n\r\n  async function handleCreatePost(event){\r\n    event.preventDefault();\r\n\r\n    const document = {\r\n      title: event.target.title.value,\r\n      description: event.target.description.value,\r\n      author: {\r\n        name: auth.currentUser.displayName,\r\n        id: auth.currentUser.uid\r\n      }\r\n    }\r\n    await addDoc(postRef, document);\r\n    navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\" onSubmit={handleCreatePost}>\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/pages/HomePage.js",
    "content": "import { useEffect, useState, useRef } from \"react\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState([]);\r\n  const [toggle, setToggle] = useState(false);\r\n  const postsRef = useRef(collection(db, \"posts\"));\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef.current);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    getPosts();\r\n  }, [postsRef, toggle]);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post) => (\r\n        <PostCard key={post.id} post={post} toggle={toggle} setToggle={setToggle} />\r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "169/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoutes } from \"./ProtectedRoutes\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <ProtectedRoutes><CreatePost /></ProtectedRoutes> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "169/src/routes/ProtectedRoutes.js",
    "content": "import { Navigate } from \"react-router-dom\"\r\n\r\nexport const ProtectedRoutes = ({children}) => {\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\") || false);\r\n    return isAuth ? children : <Navigate to=\"/\" />;\r\n}\r\n"
  },
  {
    "path": "172/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "172/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in your browser.\n\nThe page will reload when you make changes.\\\nYou may also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can't go back!**\n\nIf you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.\n\nYou don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n### Code Splitting\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)\n\n### Analyzing the Bundle Size\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)\n\n### Making a Progressive Web App\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)\n\n### Advanced Configuration\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)\n\n### Deployment\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)\n\n### `npm run build` fails to minify\n\nThis section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)\n"
  },
  {
    "path": "172/netlify.toml",
    "content": "[[redirects]]\r\nfrom = \"/*\"\r\nto = \"/index.html\"\r\nstatus = 200"
  },
  {
    "path": "172/package.json",
    "content": "{\n  \"name\": \"writenode\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.16.5\",\n    \"@testing-library/react\": \"^13.4.0\",\n    \"@testing-library/user-event\": \"^13.5.0\",\n    \"firebase\": \"9.10\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"react-loading-skeleton\": \"^3.1.0\",\n    \"react-router-dom\": \"^6.4.2\",\n    \"react-scripts\": \"5.0.1\",\n    \"web-vitals\": \"^2.1.4\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "172/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "172/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "172/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "172/src/App.css",
    "content": ".App{\n  max-width: 1200px;\n  margin: auto;\n}\n\n/* Header Component */\nheader{\n  height: 70px;\n  padding: 10px;\n  border-bottom: 1px solid #F2EBE9;\n  display: flex;\n  justify-content: space-between;\n}\n\n.logo{\n  display: flex;\n  align-items: center;\n}\n.logo img{\n  max-width: 40px;\n}\n\n.logo span{\n  font-size: 20px;\n  padding: 5px;\n}\n\n.nav{\n  display: flex;\n  align-items: center;\n}\n\n.nav .link{\n  padding: 10px;\n}\n\n.nav .link.active{\n  background-color: #F2EBE9;\n  border-radius: 5px;\n}\n\n.nav .auth{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px;\n  font-size: 16px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n.nav .auth i{\n  font-size: 14px;\n}\n\n@media screen and (max-width: 480px) {\n  .logo span{\n      display: none;\n  }\n}\n\n\n/* Card Component */\n.card{\n  border-radius: 5px;\n  padding: 10px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  margin: 20px 5px;\n}\n\n.card .title{\n  font-size: 20px;\n  margin: 20px 5px;\n  font-weight: 600;\n}\n\n.card .description{\n  font-size: 16px;\n  margin: 20px 5px;\n}\n\n.card .control {\n  font-size: 16px;\n  margin: 20px 5px;\n  display: flex;\n  justify-content: space-between;\n}\n\n.card .author {\n  font-size: 14px;\n  font-weight: 500;\n  background-color: #1c59ae13;\n  padding: 5px 10px;\n  border-radius: 5px;\n}\n\n.card .delete{\n  color: #ff4747;\n  cursor: pointer;\n}\n\n/* Create Blog Post Component */\n.create .heading{\n  text-align: center;\n  font-size: 22px;\n  margin-top: 20px;\n}\n\n.createPost{\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  margin: 20px auto;\n}\n\n.createPost .title{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n\n}\n\n.createPost .description{\n  font-size: 20px;\n  margin: 10px 0px;\n  padding: 10px;\n  border-radius: 5px;\n  border: 0px;\n  box-shadow: #F2EBE9 0px 1px 4px;\n  height: 300px;\n}\n\n.createPost button{\n  font-size: 18px;\n  margin: 10px 0px;\n  padding: 15px 20px;\n  background-color: #5FD068;\n  border: 0px;\n  border-radius: 5px;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Page Not Found  */\n.pageNotFound{\n  text-align: center;\n  max-width: 500px;\n  margin: auto;\n}\n\n.pageNotFound p {\n  font-size: 24px;\n  font-weight: 500;\n  margin: 25px auto;\n}\n\n.pageNotFound img {\n  border-radius: 5px;\n  width: 100%;\n  margin: 15px auto;\n}\n\n.pageNotFound button{\n  border: 0px;\n  border-radius: 5px;\n  margin-left: 10px;\n  padding: 10px 20px;\n  font-size: 20px;\n  background-color: #1C59AE;\n  color: #ffffff;\n  cursor: pointer;\n}\n\n\n/* Footer Component  */\nfooter{\n  height: 70px;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  border-top: 1px solid #F2EBE9;\n}"
  },
  {
    "path": "172/src/App.js",
    "content": "import { Header, Footer } from './components';\nimport { AllRoutes } from './routes/AllRoutes';\nimport './App.css';\n\nfunction App() {\n  return (\n    <div className=\"App\">\n      <Header />\n      <AllRoutes />\n      <Footer />\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "172/src/components/Footer.js",
    "content": "import { Link } from \"react-router-dom\"\r\n\r\nexport const Footer = () => {\r\n  return (\r\n    <footer>\r\n      <p>© 2030 <Link to=\"/\">WriteNode</Link>. All Rights Reserved.</p>\r\n    </footer>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/components/Header.js",
    "content": "import { Link, NavLink } from \"react-router-dom\";\r\nimport { auth, provider } from \"../firebase/config\";\r\nimport { signInWithPopup, signOut } from \"firebase/auth\";\r\nimport Logo from \"../assets/logo.png\";\r\nimport { useState } from \"react\";\r\n\r\nexport const Header = () => {\r\n  const [isAuth, setIsAuth] = useState(JSON.parse(localStorage.getItem(\"isAuth\")) || false);\r\n\r\n  function handleLogin(){\r\n    signInWithPopup(auth, provider).then((result) => {\r\n      setIsAuth(true);\r\n      localStorage.setItem(\"isAuth\", true);\r\n    })\r\n  }\r\n\r\n  function handleLogout(){\r\n    signOut(auth);\r\n    setIsAuth(false);\r\n    localStorage.setItem(\"isAuth\", false);\r\n  }\r\n\r\n  return (\r\n    <header>\r\n      <Link to=\"/\" className=\"logo\">\r\n        <img src={Logo} alt=\"WriteNode Logo\" />\r\n        <span>WriteNode</span>\r\n      </Link>\r\n      <nav className=\"nav\">\r\n        <NavLink to=\"/\" className=\"link\" end>Home</NavLink>\r\n        { isAuth ? (\r\n          <>\r\n            <NavLink to=\"/create\" className=\"link\">Create</NavLink>\r\n            <button onClick={handleLogout} className=\"auth\"><i className=\"bi bi-box-arrow-right\"></i> Logout</button> \r\n          </>                   \r\n        ) : (\r\n          <button onClick={handleLogin} className=\"auth\"><i className=\"bi bi-google\"></i> Login</button>\r\n        ) }        \r\n      </nav>\r\n    </header>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/components/PostCard.js",
    "content": "import { doc, deleteDoc } from \"firebase/firestore\";\r\nimport { auth, db } from \"../firebase/config\";\r\n\r\nexport const PostCard = ({post, toggle, setToggle}) => {\r\n    const {id, title, description, author} = post;\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\"));\r\n\r\n    async function handleDelete(){\r\n      const document = doc(db, \"posts\", id);\r\n      await deleteDoc(document);\r\n      setToggle(!toggle);\r\n    }\r\n\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{title}</p>\r\n        <p className=\"description\">{description}</p>\r\n        <p className=\"control\">\r\n            <span className=\"author\">{author.name}</span>\r\n            { isAuth && (author.id === auth.currentUser.uid) && <span onClick={handleDelete} className=\"delete\"><i className=\"bi bi-trash3\"></i></span> }\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/components/SkeletonCard.js",
    "content": "import Skeleton from 'react-loading-skeleton';\r\n\r\nexport const SkeletonCard = () => {\r\n  return (\r\n    <div className=\"card\">\r\n        <p className=\"title\">{<Skeleton />}</p>\r\n        <p className=\"description\"><Skeleton count={3} /></p>\r\n        <p className=\"control\">\r\n          <Skeleton width=\"70px\" />\r\n        </p>\r\n    </div>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/components/index.js",
    "content": "export { Header } from \"./Header\";\r\nexport { Footer } from \"./Footer\";\r\nexport { PostCard } from \"./PostCard\";\r\nexport { SkeletonCard } from \"./SkeletonCard\";"
  },
  {
    "path": "172/src/firebase/config.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore } from \"firebase/firestore\";\r\nimport { getAuth, GoogleAuthProvider } from \"firebase/auth\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: `${process.env.REACT_APP_API_KEY}`,\r\n  authDomain: `${process.env.REACT_APP_AUTH_DOMAIN}`,\r\n  projectId: `${process.env.REACT_APP_PROJECT_ID}`,\r\n  storageBucket: `${process.env.REACT_APP_STORAGE_BUCKET}`,\r\n  messagingSenderId: `${process.env.REACT_APP_MESSAGING_SENDER_ID}`,\r\n  appId: `${process.env.REACT_APP_APP_ID}`\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\n\r\nexport const db = getFirestore(app);\r\nexport const auth = getAuth(app);\r\nexport const provider = new GoogleAuthProvider();\r\n\r\n"
  },
  {
    "path": "172/src/hooks/useTitle.js",
    "content": "import { useEffect } from \"react\";\r\n\r\nexport const useTitle = (title) => {\r\n\r\n    useEffect(() => {\r\n        document.title = `${title} - WriteNode`;\r\n    }, [title]);\r\n\r\n  return null;\r\n}"
  },
  {
    "path": "172/src/index.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\n@import url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css\");\n\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n    font-family: 'Poppins', sans-serif;\n    text-decoration: none;\n    list-style: none;\n}\n\nmain {\n    min-height: 90vh;\n    padding: 10px;\n}\n\na{\n    color: #000000;\n}"
  },
  {
    "path": "172/src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\nimport './index.css';\nimport 'react-loading-skeleton/dist/skeleton.css';\nimport App from './App';\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(\n  <React.StrictMode>\n    <BrowserRouter>\n      <App />\n    </BrowserRouter>\n  </React.StrictMode>\n);"
  },
  {
    "path": "172/src/pages/CreatePost.js",
    "content": "import { useNavigate } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { addDoc, collection } from \"firebase/firestore\";\r\nimport { db, auth } from \"../firebase/config\";\r\n\r\nexport const CreatePost = () => {\r\n  const navigate = useNavigate();\r\n  useTitle(\"Create Post\");\r\n  const postRef = collection(db, \"posts\");\r\n\r\n  async function handleCreatePost(event){\r\n    event.preventDefault();\r\n\r\n    const document = {\r\n      title: event.target.title.value,\r\n      description: event.target.description.value,\r\n      author: {\r\n        name: auth.currentUser.displayName,\r\n        id: auth.currentUser.uid\r\n      }\r\n    }\r\n    await addDoc(postRef, document);\r\n    navigate(\"/\");\r\n  }\r\n\r\n  return (\r\n    <section className=\"create\">\r\n      <div className=\"heading\">\r\n        <h1>Add New Post</h1>\r\n      </div>\r\n      <form className=\"createPost\" onSubmit={handleCreatePost}>\r\n        <input type=\"text\" className=\"title\" name=\"title\" placeholder=\"Title\" maxLength=\"50\" required />\r\n        <textarea type=\"text\" className=\"description\" name=\"description\" placeholder=\"Description\" maxLength=\"600\" required ></textarea>\r\n        <button type=\"submit\" className=\"submit\">Create</button>\r\n      </form>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/pages/HomePage.js",
    "content": "import { useEffect, useState, useRef } from \"react\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport { getDocs, collection } from \"firebase/firestore\";\r\nimport { db } from \"../firebase/config\";\r\nimport { PostCard, SkeletonCard } from \"../components\";\r\n\r\nexport const HomePage = () => {\r\n  const [posts, setPosts] = useState(new Array(2).fill(false));\r\n  const [toggle, setToggle] = useState(false);\r\n  useTitle(\"Home\");\r\n  const postsRef = useRef(collection(db, \"posts\"));\r\n\r\n  useEffect(() => {\r\n    async function getPosts(){\r\n      const data = await getDocs(postsRef.current);\r\n      setPosts(data.docs.map((document) => (\r\n        {...document.data(), id: document.id}\r\n        )\r\n      ));\r\n    }\r\n    getPosts();\r\n  }, [postsRef, toggle]);\r\n\r\n  return (\r\n    <section>\r\n      { posts.map((post, index) => (\r\n        post ? (\r\n          <PostCard key={post.id} post={post} toggle={toggle} setToggle={setToggle} />\r\n        ) : (\r\n          <SkeletonCard key={index} />\r\n        )        \r\n      )) }      \r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/pages/PageNotFound.js",
    "content": "import { Link } from \"react-router-dom\";\r\nimport { useTitle } from \"../hooks/useTitle\";\r\nimport NotFound from \"../assets/images/page-not-found.jpg\";\r\n\r\nexport const PageNotFound = () => {\r\n  useTitle(\"Page Not Found\");\r\n\r\n  return (\r\n    <section className=\"pageNotFound\">\r\n      <p>404 / Page Not Found</p>\r\n      <img src={NotFound} alt=\"Page Not Found\" />\r\n      <Link to=\"/\">\r\n        <button>Back To Home</button>\r\n      </Link>\r\n    </section>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/pages/index.js",
    "content": "export { HomePage } from \"./HomePage\";\r\nexport { CreatePost } from \"./CreatePost\";\r\nexport { PageNotFound } from \"./PageNotFound\";"
  },
  {
    "path": "172/src/routes/AllRoutes.js",
    "content": "import { Routes, Route } from \"react-router-dom\";\r\nimport { HomePage, CreatePost, PageNotFound } from \"../pages\";\r\nimport { ProtectedRoutes } from \"./ProtectedRoutes\";\r\n\r\nexport const AllRoutes = () => {\r\n  return (\r\n    <main>\r\n        <Routes>\r\n            <Route path=\"/\" element={ <HomePage />} />\r\n            <Route path=\"create\" element={ <ProtectedRoutes><CreatePost /></ProtectedRoutes> } />\r\n            <Route path=\"*\" element={ <PageNotFound /> } />\r\n        </Routes>\r\n    </main>\r\n  )\r\n}\r\n"
  },
  {
    "path": "172/src/routes/ProtectedRoutes.js",
    "content": "import { Navigate } from \"react-router-dom\"\r\n\r\nexport const ProtectedRoutes = ({children}) => {\r\n    const isAuth = JSON.parse(localStorage.getItem(\"isAuth\") || false);\r\n    return isAuth ? children : <Navigate to=\"/\" />;\r\n}\r\n"
  },
  {
    "path": "206/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\" class=\"\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>LearnTailwind - Learning Tailwind With Examples</title>\r\n    <link rel=\"shortcut icon\" href=\"./images/favicon.ico\" type=\"image/x-icon\">\r\n    <link rel=\"stylesheet\" href=\"./style.css\">\r\n\r\n    <script src=\"https://cdn.tailwindcss.com\"></script>\r\n    <script src=\"./index.js\"></script>\r\n</head>\r\n\r\n<body>\r\n    <h1 class=\"text-5xl bg-amber-500 hover:bg-red-500 hover:text-white hover:cursor-pointer text-center py-7 m-4 border-4 rounded-md border-indigo-700 border-dashed\">Learning Tailwind</h1>\r\n    <p class=\"text-2xl md:max-lg:bg-red-500 p-2 m-2\">Hello World!</p>\r\n    <p class=\"bg-abc-200 dark:bg-abc-800\">Learning <span class=\"text-4xl text-red-700\">tailwindcss</span> with Shubham!</p>\r\n</body>\r\n\r\n</html>"
  },
  {
    "path": "206/index.js",
    "content": "tailwind.config = {\r\n    darkMode: 'class',\r\n    theme: {\r\n        extend: {\r\n            colors: {\r\n                \"abc\" : {\r\n                    100: '#cffafe',\r\n                    200: '#a5f3fc',\r\n                    300: '#67e8f9',\r\n                    400: '#22d3ee',\r\n                    500: '#06b6d4',\r\n                    600: '#0891b2',\r\n                    700: '#0e7490',\r\n                    800: '#155e75',\r\n                    900: '#164e63',\r\n                  }\r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "206/style.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n}"
  },
  {
    "path": "207/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\" class=\"\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>SoundMate - Learning Tailwind With Examples</title>\r\n    <link rel=\"shortcut icon\" href=\"./images/favicon.ico\" type=\"image/x-icon\">\r\n    <link rel=\"stylesheet\" href=\"./style.css\">\r\n\r\n    <script src=\"https://cdn.tailwindcss.com\"></script>\r\n    <script src=\"./index.js\"></script>\r\n</head>\r\n\r\n<body>\r\n    <div class=\"max-w-7xl m-auto\">\r\n        <header class=\"h-16 border-b\">\r\n            <div class=\"flex justify-between items-center py-2 mx-2\">\r\n                <div class=\"flex items-center\">\r\n                    <img class=\"w-12\" src=\"./images/logo.png\" alt=\"SoundMate Logo\">\r\n                    <span class=\"ml-2 text-2xl\">SoundMate</span>\r\n                </div>\r\n                <nav>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">Home</span>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">Products</span>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">About Us</span>\r\n                </nav>\r\n            </div>\r\n        </header>\r\n        <main></main>\r\n        <footer></footer>\r\n    </div>\r\n</body>\r\n\r\n</html>"
  },
  {
    "path": "207/index.js",
    "content": "tailwind.config = {\r\n    darkMode: 'class',\r\n    theme: {\r\n        extend: {\r\n            colors: {\r\n                \"logo\": {\r\n                    700: \"#1C59AE\",\r\n                    800: \"#114a9a\",\r\n                } \r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "207/style.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n}"
  },
  {
    "path": "208/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\" class=\"\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>SoundMate - Learning Tailwind With Examples</title>\r\n    <link rel=\"shortcut icon\" href=\"./images/favicon.ico\" type=\"image/x-icon\">\r\n    <link rel=\"stylesheet\" href=\"./style.css\">\r\n\r\n    <script src=\"https://cdn.tailwindcss.com\"></script>\r\n    <script src=\"./index.js\"></script>\r\n</head>\r\n\r\n<body>\r\n    <div class=\"max-w-7xl m-auto\">\r\n        <header class=\"h-16 border-b\">\r\n            <div class=\"flex justify-between items-center py-2 mx-2\">\r\n                <div class=\"flex items-center\">\r\n                    <img class=\"w-12\" src=\"./images/logo.png\" alt=\"SoundMate Logo\">\r\n                    <span class=\"ml-2 text-2xl\">SoundMate</span>\r\n                </div>\r\n                <nav>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">Home</span>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">Products</span>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">About Us</span>\r\n                </nav>\r\n            </div>\r\n        </header>\r\n\r\n        <main>\r\n            <section class=\"text-center my-20\">\r\n                <h1 class=\"text-4xl\">Lorem ipsum dolor</h1>\r\n                <p class=\"text-xl mt-2 mb-7\">Lorem ipsum dolor sit amet consectetur adipisicing.</p>\r\n                <button class=\"text-lg border p-3 rounded-lg text-slate-50 bg-logo-700 hover:bg-logo-800\">Know More</button>\r\n            </section>\r\n\r\n            <section class=\"my-3\">\r\n                <div class=\"flex justify-center flex-wrap\">\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                </div>\r\n            </section>\r\n\r\n        </main>\r\n\r\n        <footer></footer>\r\n    </div>\r\n</body>\r\n\r\n</html>"
  },
  {
    "path": "208/index.js",
    "content": "tailwind.config = {\r\n    darkMode: 'class',\r\n    theme: {\r\n        extend: {\r\n            colors: {\r\n                \"logo\": {\r\n                    700: \"#1C59AE\",\r\n                    800: \"#114a9a\",\r\n                } \r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "208/style.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n}"
  },
  {
    "path": "209/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\" class=\"\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>SoundMate - Learning Tailwind With Examples</title>\r\n    <link rel=\"shortcut icon\" href=\"./images/favicon.ico\" type=\"image/x-icon\">\r\n    <link rel=\"stylesheet\" href=\"./style.css\">\r\n\r\n    <script src=\"https://cdn.tailwindcss.com\"></script>\r\n    <script src=\"./index.js\"></script>\r\n</head>\r\n\r\n<body>\r\n    <div class=\"max-w-7xl m-auto\">\r\n        <header class=\"h-16 border-b\">\r\n            <div class=\"flex justify-between items-center py-2 mx-2\">\r\n                <div class=\"flex items-center\">\r\n                    <img class=\"w-12\" src=\"./images/logo.png\" alt=\"SoundMate Logo\">\r\n                    <span class=\"ml-2 text-2xl\">SoundMate</span>\r\n                </div>\r\n                <nav>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">Home</span>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">Products</span>\r\n                    <span class=\"p-3 text-lg hover:bg-gray-300 hover:cursor-pointer hover:rounded\">About Us</span>\r\n                </nav>\r\n            </div>\r\n        </header>\r\n\r\n        <main>\r\n            <section class=\"text-center my-20\">\r\n                <h1 class=\"text-4xl\">Lorem ipsum dolor</h1>\r\n                <p class=\"text-xl mt-2 mb-7\">Lorem ipsum dolor sit amet consectetur adipisicing.</p>\r\n                <button class=\"text-lg border p-3 rounded-lg text-slate-50 bg-logo-700 hover:bg-logo-800\">Know More</button>\r\n            </section>\r\n\r\n            <section class=\"\">\r\n                <div class=\"flex justify-center flex-wrap\">\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                </div>\r\n            </section>\r\n\r\n        </main>\r\n\r\n        <footer class=\"h-16 border-t py-4 text-center mt-7\">\r\n            <p class=\"text-lg text-slate-900\">SoundMate 2030</p>\r\n        </footer>\r\n    </div>\r\n</body>\r\n\r\n</html>"
  },
  {
    "path": "209/index.js",
    "content": "tailwind.config = {\r\n    darkMode: 'class',\r\n    theme: {\r\n        extend: {\r\n            colors: {\r\n                \"logo\": {\r\n                    700: \"#1C59AE\",\r\n                    800: \"#114a9a\",\r\n                } \r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "209/style.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n}"
  },
  {
    "path": "210/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\" class=\"\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>SoundMate - Learning Tailwind With Examples</title>\r\n    <link rel=\"shortcut icon\" href=\"./images/favicon.ico\" type=\"image/x-icon\">\r\n    <link rel=\"stylesheet\" href=\"./style.css\">\r\n\r\n    <script src=\"https://cdn.tailwindcss.com\"></script>\r\n    <script src=\"./index.js\"></script>\r\n</head>\r\n\r\n<body>\r\n    <div class=\"max-w-7xl m-auto\">\r\n        <header class=\"h-28 sm:h-16 border-b\">\r\n            <div class=\"flex flex-col sm:flex-row justify-between items-center py-2 mx-2\">\r\n                <div class=\"flex items-center\">\r\n                    <img class=\"w-12\" src=\"./images/logo.png\" alt=\"SoundMate Logo\">\r\n                    <span class=\"ml-2 text-2xl\">SoundMate</span>\r\n                </div>\r\n                <nav class=\"max-sm:my-3\">\r\n                    <span class=\"p-2 text-lg hover:bg-gray-100 hover:cursor-pointer hover:rounded\">Home</span>\r\n                    <span class=\"p-2 text-lg hover:bg-gray-100 hover:cursor-pointer hover:rounded\">Products</span>\r\n                    <span class=\"p-2 text-lg hover:bg-gray-100 hover:cursor-pointer hover:rounded\">About Us</span>\r\n                </nav>\r\n            </div>\r\n        </header>\r\n\r\n        <main>\r\n            <section class=\"text-center my-20\">\r\n                <h1 class=\"max-sm:text-3xl text-4xl\">Lorem ipsum dolor</h1>\r\n                <p class=\"max-sm:text-lg text-xl mt-2 mb-7\">Lorem ipsum dolor sit amet consectetur adipisicing.</p>\r\n                <button class=\"text-lg border p-3 rounded-lg text-slate-50 bg-logo-700 hover:bg-logo-800\">Know More</button>\r\n            </section>\r\n\r\n            <section class=\"\">\r\n                <div class=\"flex justify-center flex-wrap\">\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                    <div class=\"max-w-sm border rounded p-3 hover:cursor-pointer m-4\">\r\n                        <img class=\"rounded-md\" src=\"./images/product.jpg\" alt=\"Headphone\">\r\n                        <h1 class=\"text-2xl my-5\">Sony WH-1000XM4</h1>\r\n                        <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sapiente, repudiandae!</p>\r\n                    </div>\r\n                </div>\r\n            </section>\r\n\r\n        </main>\r\n\r\n        <footer class=\"h-16 border-t py-4 text-center mt-7\">\r\n            <p class=\"text-lg text-slate-900\">SoundMate 2030</p>\r\n        </footer>\r\n    </div>\r\n</body>\r\n\r\n</html>"
  },
  {
    "path": "210/index.js",
    "content": "tailwind.config = {\r\n    darkMode: 'class',\r\n    theme: {\r\n        extend: {\r\n            colors: {\r\n                \"logo\": {\r\n                    700: \"#1C59AE\",\r\n                    800: \"#114a9a\",\r\n                } \r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "210/style.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto&display=swap');\r\n\r\n* {\r\n    font-family: 'Poppins', sans-serif;\r\n}"
  },
  {
    "path": "252/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ (() => {\n\neval(\"console.log(\\\"Updated Message!\\\");\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = {};\n/******/ \t__webpack_modules__[\"./src/index.js\"]();\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "252/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "252/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  }\n}\n"
  },
  {
    "path": "252/src/index.js",
    "content": "console.log(\"Updated Message!\");"
  },
  {
    "path": "252/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "253/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ (() => {\n\neval(\"console.log(\\\"Updated Message!\\\");\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = {};\n/******/ \t__webpack_modules__[\"./src/index.js\"]();\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "253/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "253/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  }\n}\n"
  },
  {
    "path": "253/src/index.js",
    "content": "console.log(\"Updated Message!\");"
  },
  {
    "path": "253/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "254/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ (() => {\n\neval(\"console.log(\\\"Updated Message!\\\");\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = {};\n/******/ \t__webpack_modules__[\"./src/index.js\"]();\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "254/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "254/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "254/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);"
  },
  {
    "path": "254/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "255/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef).then(data => {\\r\\n    data.docs.forEach(document => {\\r\\n        console.log(document.id);\\r\\n    })\\r\\n})\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "255/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "255/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "255/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs } from \"firebase/firestore\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\n\r\n\r\ngetDocs(colRef).then(data => {\r\n    data.docs.forEach(document => {\r\n        console.log(document.id);\r\n    })\r\n})"
  },
  {
    "path": "255/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "256/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "256/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "256/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "256/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs } from \"firebase/firestore\";\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });"
  },
  {
    "path": "256/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "257/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n    \\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        description: addForm.description.value\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference).then(() => {\\r\\n        deleteForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "257/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Description\" name=\"description\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "257/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "257/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, addDoc, deleteDoc, doc } from \"firebase/firestore\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n    \r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        description: addForm.description.value\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference).then(() => {\r\n        deleteForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "257/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "258/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        description: addForm.description.value\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "258/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Description\" name=\"description\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "258/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "258/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc } from \"firebase/firestore\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        description: addForm.description.value\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "258/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "259/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\nconst qRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.query)(colRef, (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.where)(\\\"category\\\", \\\"==\\\", \\\"drama\\\"));\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(qRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        description: addForm.description.value,\\r\\n        category: addForm.category.value\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "259/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Description\" name=\"description\" autocomplete=\"off\">\r\n        <select name=\"category\" id=\"\">\r\n            <option value=\"drama\">Drama</option>\r\n            <option value=\"action\">Action</option>\r\n            <option value=\"comedy\">Comedy</option>\r\n        </select>\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "259/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "259/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc, query, where} from \"firebase/firestore\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\nconst qRef = query(colRef, where(\"category\", \"==\", \"drama\"));\r\n\r\n\r\ngetDocs(qRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        description: addForm.description.value,\r\n        category: addForm.category.value\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "259/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "260/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\nconst qRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.query)(colRef, (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.where)(\\\"category\\\", \\\"==\\\", \\\"drama\\\"), (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.orderBy)(\\\"createdAt\\\"));\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        category: addForm.category.value,\\r\\n        createdAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)(),\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "260/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <select name=\"category\" id=\"\">\r\n            <option value=\"drama\">Drama</option>\r\n            <option value=\"action\">Action</option>\r\n            <option value=\"comedy\">Comedy</option>\r\n        </select>\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "260/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "260/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc, query, where, orderBy, serverTimestamp} from \"firebase/firestore\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\nconst qRef = query(colRef, where(\"category\", \"==\", \"drama\"), orderBy(\"createdAt\"));\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        category: addForm.category.value,\r\n        createdAt: serverTimestamp(),\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "260/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "261/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\nconst qRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.query)(colRef, (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.where)(\\\"category\\\", \\\"==\\\", \\\"drama\\\"), (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.orderBy)(\\\"createdAt\\\"));\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        category: addForm.category.value,\\r\\n        createdAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)(),\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst updateForm = document.querySelector(\\\".update\\\");\\r\\nupdateForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", updateForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.updateDoc)(documentReference, {\\r\\n        name: updateForm.name.value,\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        updateForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "261/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <select name=\"category\" id=\"\">\r\n            <option value=\"drama\">Drama</option>\r\n            <option value=\"action\">Action</option>\r\n            <option value=\"comedy\">Comedy</option>\r\n        </select>\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n\r\n    <form class=\"update\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Update Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "261/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "261/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc, query, where, orderBy, serverTimestamp, updateDoc} from \"firebase/firestore\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\nconst qRef = query(colRef, where(\"category\", \"==\", \"drama\"), orderBy(\"createdAt\"));\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        category: addForm.category.value,\r\n        createdAt: serverTimestamp(),\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst updateForm = document.querySelector(\".update\");\r\nupdateForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n\r\n    const documentReference = doc(db, \"movies\", updateForm.id.value);\r\n    updateDoc(documentReference, {\r\n        name: updateForm.name.value,\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        updateForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "261/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "262/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\nconst qRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.query)(colRef, (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.where)(\\\"category\\\", \\\"==\\\", \\\"drama\\\"), (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.orderBy)(\\\"createdAt\\\"));\\r\\n\\r\\n\\r\\n// const documentReference = doc(db, \\\"movies\\\", \\\"uwmpf5Z4D3N1maXYlfHn\\\");\\r\\n// onSnapshot(documentReference, (document) => {\\r\\n//     console.log(document.data(), document.id);\\r\\n// });\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        category: addForm.category.value,\\r\\n        createdAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)(),\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst updateForm = document.querySelector(\\\".update\\\");\\r\\nupdateForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", updateForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.updateDoc)(documentReference, {\\r\\n        name: updateForm.name.value,\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        updateForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "262/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <select name=\"category\" id=\"\">\r\n            <option value=\"drama\">Drama</option>\r\n            <option value=\"action\">Action</option>\r\n            <option value=\"comedy\">Comedy</option>\r\n        </select>\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n\r\n    <form class=\"update\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Update Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "262/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "262/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc, query, where, orderBy, serverTimestamp, updateDoc} from \"firebase/firestore\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst colRef = collection(db, \"movies\");\r\nconst qRef = query(colRef, where(\"category\", \"==\", \"drama\"), orderBy(\"createdAt\"));\r\n\r\n\r\n// const documentReference = doc(db, \"movies\", \"uwmpf5Z4D3N1maXYlfHn\");\r\n// onSnapshot(documentReference, (document) => {\r\n//     console.log(document.data(), document.id);\r\n// });\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        category: addForm.category.value,\r\n        createdAt: serverTimestamp(),\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst updateForm = document.querySelector(\".update\");\r\nupdateForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n\r\n    const documentReference = doc(db, \"movies\", updateForm.id.value);\r\n    updateDoc(documentReference, {\r\n        name: updateForm.name.value,\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        updateForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "262/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "263/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\nconst qRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.query)(colRef, (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.where)(\\\"category\\\", \\\"==\\\", \\\"drama\\\"), (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.orderBy)(\\\"createdAt\\\"));\\r\\n\\r\\n\\r\\n// const documentReference = doc(db, \\\"movies\\\", \\\"uwmpf5Z4D3N1maXYlfHn\\\");\\r\\n// onSnapshot(documentReference, (document) => {\\r\\n//     console.log(document.data(), document.id);\\r\\n// });\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        category: addForm.category.value,\\r\\n        createdAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)(),\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst updateForm = document.querySelector(\\\".update\\\");\\r\\nupdateForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", updateForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.updateDoc)(documentReference, {\\r\\n        name: updateForm.name.value,\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        updateForm.reset();\\r\\n    });\\r\\n});\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "263/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <select name=\"category\" id=\"\">\r\n            <option value=\"drama\">Drama</option>\r\n            <option value=\"action\">Action</option>\r\n            <option value=\"comedy\">Comedy</option>\r\n        </select>\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n\r\n    <form class=\"update\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Update Movie\">\r\n    </form>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "263/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "263/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc, query, where, orderBy, serverTimestamp, updateDoc} from \"firebase/firestore\";\r\nimport { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut } from \"firebase/auth\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst auth = getAuth();\r\n\r\nconst colRef = collection(db, \"movies\");\r\nconst qRef = query(colRef, where(\"category\", \"==\", \"drama\"), orderBy(\"createdAt\"));\r\n\r\n\r\n// const documentReference = doc(db, \"movies\", \"uwmpf5Z4D3N1maXYlfHn\");\r\n// onSnapshot(documentReference, (document) => {\r\n//     console.log(document.data(), document.id);\r\n// });\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        category: addForm.category.value,\r\n        createdAt: serverTimestamp(),\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst updateForm = document.querySelector(\".update\");\r\nupdateForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n\r\n    const documentReference = doc(db, \"movies\", updateForm.id.value);\r\n    updateDoc(documentReference, {\r\n        name: updateForm.name.value,\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        updateForm.reset();\r\n    });\r\n});"
  },
  {
    "path": "263/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  },
  {
    "path": "264/dist/bundle.js",
    "content": "/*\n * ATTENTION: The \"eval\" devtool has been used (maybe by default in mode: \"development\").\n * This devtool is neither made for production nor for readable output files.\n * It uses \"eval()\" calls to create a separate source file in the browser devtools.\n * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)\n * or disable the default devtool with \"devtool: false\".\n * If you are looking for production-ready output files, see mode: \"production\" (https://webpack.js.org/configuration/mode/).\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./node_modules/@firebase/auth/dist/esm2017/index-3b632d0b.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/auth/dist/esm2017/index-3b632d0b.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"$\\\": () => (/* binding */ signInWithCustomToken),\\n/* harmony export */   \\\"A\\\": () => (/* binding */ ActionCodeOperation),\\n/* harmony export */   \\\"B\\\": () => (/* binding */ debugErrorMap),\\n/* harmony export */   \\\"C\\\": () => (/* binding */ prodErrorMap),\\n/* harmony export */   \\\"D\\\": () => (/* binding */ AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY),\\n/* harmony export */   \\\"E\\\": () => (/* binding */ initializeAuth),\\n/* harmony export */   \\\"F\\\": () => (/* binding */ FactorId),\\n/* harmony export */   \\\"G\\\": () => (/* binding */ connectAuthEmulator),\\n/* harmony export */   \\\"H\\\": () => (/* binding */ AuthCredential),\\n/* harmony export */   \\\"I\\\": () => (/* binding */ EmailAuthCredential),\\n/* harmony export */   \\\"J\\\": () => (/* binding */ OAuthCredential),\\n/* harmony export */   \\\"K\\\": () => (/* binding */ PhoneAuthCredential),\\n/* harmony export */   \\\"L\\\": () => (/* binding */ inMemoryPersistence),\\n/* harmony export */   \\\"M\\\": () => (/* binding */ EmailAuthProvider),\\n/* harmony export */   \\\"N\\\": () => (/* binding */ FacebookAuthProvider),\\n/* harmony export */   \\\"O\\\": () => (/* binding */ OperationType),\\n/* harmony export */   \\\"P\\\": () => (/* binding */ PhoneAuthProvider),\\n/* harmony export */   \\\"Q\\\": () => (/* binding */ GoogleAuthProvider),\\n/* harmony export */   \\\"R\\\": () => (/* binding */ RecaptchaVerifier),\\n/* harmony export */   \\\"S\\\": () => (/* binding */ SignInMethod),\\n/* harmony export */   \\\"T\\\": () => (/* binding */ GithubAuthProvider),\\n/* harmony export */   \\\"U\\\": () => (/* binding */ OAuthProvider),\\n/* harmony export */   \\\"V\\\": () => (/* binding */ SAMLAuthProvider),\\n/* harmony export */   \\\"W\\\": () => (/* binding */ TwitterAuthProvider),\\n/* harmony export */   \\\"X\\\": () => (/* binding */ signInAnonymously),\\n/* harmony export */   \\\"Y\\\": () => (/* binding */ signInWithCredential),\\n/* harmony export */   \\\"Z\\\": () => (/* binding */ linkWithCredential),\\n/* harmony export */   \\\"_\\\": () => (/* binding */ reauthenticateWithCredential),\\n/* harmony export */   \\\"a\\\": () => (/* binding */ browserSessionPersistence),\\n/* harmony export */   \\\"a0\\\": () => (/* binding */ sendPasswordResetEmail),\\n/* harmony export */   \\\"a1\\\": () => (/* binding */ confirmPasswordReset),\\n/* harmony export */   \\\"a2\\\": () => (/* binding */ applyActionCode),\\n/* harmony export */   \\\"a3\\\": () => (/* binding */ checkActionCode),\\n/* harmony export */   \\\"a4\\\": () => (/* binding */ verifyPasswordResetCode),\\n/* harmony export */   \\\"a5\\\": () => (/* binding */ createUserWithEmailAndPassword),\\n/* harmony export */   \\\"a6\\\": () => (/* binding */ signInWithEmailAndPassword),\\n/* harmony export */   \\\"a7\\\": () => (/* binding */ sendSignInLinkToEmail),\\n/* harmony export */   \\\"a8\\\": () => (/* binding */ isSignInWithEmailLink),\\n/* harmony export */   \\\"a9\\\": () => (/* binding */ signInWithEmailLink),\\n/* harmony export */   \\\"aA\\\": () => (/* binding */ AuthEventManager),\\n/* harmony export */   \\\"aB\\\": () => (/* binding */ _getRedirectResult),\\n/* harmony export */   \\\"aC\\\": () => (/* binding */ _overrideRedirectResult),\\n/* harmony export */   \\\"aD\\\": () => (/* binding */ _clearRedirectOutcomes),\\n/* harmony export */   \\\"aE\\\": () => (/* binding */ _castAuth),\\n/* harmony export */   \\\"aF\\\": () => (/* binding */ UserImpl),\\n/* harmony export */   \\\"aG\\\": () => (/* binding */ AuthImpl),\\n/* harmony export */   \\\"aH\\\": () => (/* binding */ _getClientVersion),\\n/* harmony export */   \\\"aI\\\": () => (/* binding */ _generateEventId),\\n/* harmony export */   \\\"aJ\\\": () => (/* binding */ AuthPopup),\\n/* harmony export */   \\\"aK\\\": () => (/* binding */ FetchProvider),\\n/* harmony export */   \\\"aL\\\": () => (/* binding */ SAMLAuthCredential),\\n/* harmony export */   \\\"aa\\\": () => (/* binding */ fetchSignInMethodsForEmail),\\n/* harmony export */   \\\"ab\\\": () => (/* binding */ sendEmailVerification),\\n/* harmony export */   \\\"ac\\\": () => (/* binding */ verifyBeforeUpdateEmail),\\n/* harmony export */   \\\"ad\\\": () => (/* binding */ ActionCodeURL),\\n/* harmony export */   \\\"ae\\\": () => (/* binding */ parseActionCodeURL),\\n/* harmony export */   \\\"af\\\": () => (/* binding */ updateProfile),\\n/* harmony export */   \\\"ag\\\": () => (/* binding */ updateEmail),\\n/* harmony export */   \\\"ah\\\": () => (/* binding */ updatePassword),\\n/* harmony export */   \\\"ai\\\": () => (/* binding */ getIdToken),\\n/* harmony export */   \\\"aj\\\": () => (/* binding */ getIdTokenResult),\\n/* harmony export */   \\\"ak\\\": () => (/* binding */ unlink),\\n/* harmony export */   \\\"al\\\": () => (/* binding */ getAdditionalUserInfo),\\n/* harmony export */   \\\"am\\\": () => (/* binding */ reload),\\n/* harmony export */   \\\"an\\\": () => (/* binding */ getMultiFactorResolver),\\n/* harmony export */   \\\"ao\\\": () => (/* binding */ multiFactor),\\n/* harmony export */   \\\"ap\\\": () => (/* binding */ _isIOS7Or8),\\n/* harmony export */   \\\"aq\\\": () => (/* binding */ debugAssert),\\n/* harmony export */   \\\"ar\\\": () => (/* binding */ _isIOS),\\n/* harmony export */   \\\"as\\\": () => (/* binding */ _isAndroid),\\n/* harmony export */   \\\"at\\\": () => (/* binding */ _fail),\\n/* harmony export */   \\\"au\\\": () => (/* binding */ _getRedirectUrl),\\n/* harmony export */   \\\"av\\\": () => (/* binding */ _getProjectConfig),\\n/* harmony export */   \\\"aw\\\": () => (/* binding */ _createError),\\n/* harmony export */   \\\"ax\\\": () => (/* binding */ _assert),\\n/* harmony export */   \\\"ay\\\": () => (/* binding */ _getInstance),\\n/* harmony export */   \\\"az\\\": () => (/* binding */ _persistenceKeyName),\\n/* harmony export */   \\\"b\\\": () => (/* binding */ browserLocalPersistence),\\n/* harmony export */   \\\"c\\\": () => (/* binding */ signInWithPopup),\\n/* harmony export */   \\\"d\\\": () => (/* binding */ linkWithPopup),\\n/* harmony export */   \\\"e\\\": () => (/* binding */ reauthenticateWithPopup),\\n/* harmony export */   \\\"f\\\": () => (/* binding */ signInWithRedirect),\\n/* harmony export */   \\\"g\\\": () => (/* binding */ linkWithRedirect),\\n/* harmony export */   \\\"h\\\": () => (/* binding */ reauthenticateWithRedirect),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ indexedDBLocalPersistence),\\n/* harmony export */   \\\"j\\\": () => (/* binding */ getRedirectResult),\\n/* harmony export */   \\\"k\\\": () => (/* binding */ browserPopupRedirectResolver),\\n/* harmony export */   \\\"l\\\": () => (/* binding */ linkWithPhoneNumber),\\n/* harmony export */   \\\"m\\\": () => (/* binding */ PhoneMultiFactorGenerator),\\n/* harmony export */   \\\"n\\\": () => (/* binding */ getAuth),\\n/* harmony export */   \\\"o\\\": () => (/* binding */ ProviderId),\\n/* harmony export */   \\\"p\\\": () => (/* binding */ setPersistence),\\n/* harmony export */   \\\"q\\\": () => (/* binding */ onIdTokenChanged),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ reauthenticateWithPhoneNumber),\\n/* harmony export */   \\\"s\\\": () => (/* binding */ signInWithPhoneNumber),\\n/* harmony export */   \\\"t\\\": () => (/* binding */ beforeAuthStateChanged),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ updatePhoneNumber),\\n/* harmony export */   \\\"v\\\": () => (/* binding */ onAuthStateChanged),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ useDeviceLanguage),\\n/* harmony export */   \\\"x\\\": () => (/* binding */ updateCurrentUser),\\n/* harmony export */   \\\"y\\\": () => (/* binding */ signOut),\\n/* harmony export */   \\\"z\\\": () => (/* binding */ deleteUser)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ \\\"./node_modules/tslib/tslib.es6.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * An enum of factors that may be used for multifactor authentication.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst FactorId = {\\r\\n    /** Phone as second factor */\\r\\n    PHONE: 'phone'\\r\\n};\\r\\n/**\\r\\n * Enumeration of supported providers.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst ProviderId = {\\r\\n    /** Facebook provider ID */\\r\\n    FACEBOOK: 'facebook.com',\\r\\n    /** GitHub provider ID */\\r\\n    GITHUB: 'github.com',\\r\\n    /** Google provider ID */\\r\\n    GOOGLE: 'google.com',\\r\\n    /** Password provider */\\r\\n    PASSWORD: 'password',\\r\\n    /** Phone provider */\\r\\n    PHONE: 'phone',\\r\\n    /** Twitter provider ID */\\r\\n    TWITTER: 'twitter.com'\\r\\n};\\r\\n/**\\r\\n * Enumeration of supported sign-in methods.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SignInMethod = {\\r\\n    /** Email link sign in method */\\r\\n    EMAIL_LINK: 'emailLink',\\r\\n    /** Email/password sign in method */\\r\\n    EMAIL_PASSWORD: 'password',\\r\\n    /** Facebook sign in method */\\r\\n    FACEBOOK: 'facebook.com',\\r\\n    /** GitHub sign in method */\\r\\n    GITHUB: 'github.com',\\r\\n    /** Google sign in method */\\r\\n    GOOGLE: 'google.com',\\r\\n    /** Phone sign in method */\\r\\n    PHONE: 'phone',\\r\\n    /** Twitter sign in method */\\r\\n    TWITTER: 'twitter.com'\\r\\n};\\r\\n/**\\r\\n * Enumeration of supported operation types.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst OperationType = {\\r\\n    /** Operation involving linking an additional provider to an already signed-in user. */\\r\\n    LINK: 'link',\\r\\n    /** Operation involving using a provider to reauthenticate an already signed-in user. */\\r\\n    REAUTHENTICATE: 'reauthenticate',\\r\\n    /** Operation involving signing in a user. */\\r\\n    SIGN_IN: 'signIn'\\r\\n};\\r\\n/**\\r\\n * An enumeration of the possible email action types.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst ActionCodeOperation = {\\r\\n    /** The email link sign-in action. */\\r\\n    EMAIL_SIGNIN: 'EMAIL_SIGNIN',\\r\\n    /** The password reset action. */\\r\\n    PASSWORD_RESET: 'PASSWORD_RESET',\\r\\n    /** The email revocation action. */\\r\\n    RECOVER_EMAIL: 'RECOVER_EMAIL',\\r\\n    /** The revert second factor addition email action. */\\r\\n    REVERT_SECOND_FACTOR_ADDITION: 'REVERT_SECOND_FACTOR_ADDITION',\\r\\n    /** The revert second factor addition email action. */\\r\\n    VERIFY_AND_CHANGE_EMAIL: 'VERIFY_AND_CHANGE_EMAIL',\\r\\n    /** The email verification action. */\\r\\n    VERIFY_EMAIL: 'VERIFY_EMAIL'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _debugErrorMap() {\\r\\n    return {\\r\\n        [\\\"admin-restricted-operation\\\" /* ADMIN_ONLY_OPERATION */]: 'This operation is restricted to administrators only.',\\r\\n        [\\\"argument-error\\\" /* ARGUMENT_ERROR */]: '',\\r\\n        [\\\"app-not-authorized\\\" /* APP_NOT_AUTHORIZED */]: \\\"This app, identified by the domain where it's hosted, is not \\\" +\\r\\n            'authorized to use Firebase Authentication with the provided API key. ' +\\r\\n            'Review your key configuration in the Google API console.',\\r\\n        [\\\"app-not-installed\\\" /* APP_NOT_INSTALLED */]: 'The requested mobile application corresponding to the identifier (' +\\r\\n            'Android package name or iOS bundle ID) provided is not installed on ' +\\r\\n            'this device.',\\r\\n        [\\\"captcha-check-failed\\\" /* CAPTCHA_CHECK_FAILED */]: 'The reCAPTCHA response token provided is either invalid, expired, ' +\\r\\n            'already used or the domain associated with it does not match the list ' +\\r\\n            'of whitelisted domains.',\\r\\n        [\\\"code-expired\\\" /* CODE_EXPIRED */]: 'The SMS code has expired. Please re-send the verification code to try ' +\\r\\n            'again.',\\r\\n        [\\\"cordova-not-ready\\\" /* CORDOVA_NOT_READY */]: 'Cordova framework is not ready.',\\r\\n        [\\\"cors-unsupported\\\" /* CORS_UNSUPPORTED */]: 'This browser is not supported.',\\r\\n        [\\\"credential-already-in-use\\\" /* CREDENTIAL_ALREADY_IN_USE */]: 'This credential is already associated with a different user account.',\\r\\n        [\\\"custom-token-mismatch\\\" /* CREDENTIAL_MISMATCH */]: 'The custom token corresponds to a different audience.',\\r\\n        [\\\"requires-recent-login\\\" /* CREDENTIAL_TOO_OLD_LOGIN_AGAIN */]: 'This operation is sensitive and requires recent authentication. Log in ' +\\r\\n            'again before retrying this request.',\\r\\n        [\\\"dependent-sdk-initialized-before-auth\\\" /* DEPENDENT_SDK_INIT_BEFORE_AUTH */]: 'Another Firebase SDK was initialized and is trying to use Auth before Auth is ' +\\r\\n            'initialized. Please be sure to call `initializeAuth` or `getAuth` before ' +\\r\\n            'starting any other Firebase SDK.',\\r\\n        [\\\"dynamic-link-not-activated\\\" /* DYNAMIC_LINK_NOT_ACTIVATED */]: 'Please activate Dynamic Links in the Firebase Console and agree to the terms and ' +\\r\\n            'conditions.',\\r\\n        [\\\"email-change-needs-verification\\\" /* EMAIL_CHANGE_NEEDS_VERIFICATION */]: 'Multi-factor users must always have a verified email.',\\r\\n        [\\\"email-already-in-use\\\" /* EMAIL_EXISTS */]: 'The email address is already in use by another account.',\\r\\n        [\\\"emulator-config-failed\\\" /* EMULATOR_CONFIG_FAILED */]: 'Auth instance has already been used to make a network call. Auth can ' +\\r\\n            'no longer be configured to use the emulator. Try calling ' +\\r\\n            '\\\"connectAuthEmulator()\\\" sooner.',\\r\\n        [\\\"expired-action-code\\\" /* EXPIRED_OOB_CODE */]: 'The action code has expired.',\\r\\n        [\\\"cancelled-popup-request\\\" /* EXPIRED_POPUP_REQUEST */]: 'This operation has been cancelled due to another conflicting popup being opened.',\\r\\n        [\\\"internal-error\\\" /* INTERNAL_ERROR */]: 'An internal AuthError has occurred.',\\r\\n        [\\\"invalid-app-credential\\\" /* INVALID_APP_CREDENTIAL */]: 'The phone verification request contains an invalid application verifier.' +\\r\\n            ' The reCAPTCHA token response is either invalid or expired.',\\r\\n        [\\\"invalid-app-id\\\" /* INVALID_APP_ID */]: 'The mobile app identifier is not registed for the current project.',\\r\\n        [\\\"invalid-user-token\\\" /* INVALID_AUTH */]: \\\"This user's credential isn't valid for this project. This can happen \\\" +\\r\\n            \\\"if the user's token has been tampered with, or if the user isn't for \\\" +\\r\\n            'the project associated with this API key.',\\r\\n        [\\\"invalid-auth-event\\\" /* INVALID_AUTH_EVENT */]: 'An internal AuthError has occurred.',\\r\\n        [\\\"invalid-verification-code\\\" /* INVALID_CODE */]: 'The SMS verification code used to create the phone auth credential is ' +\\r\\n            'invalid. Please resend the verification code sms and be sure to use the ' +\\r\\n            'verification code provided by the user.',\\r\\n        [\\\"invalid-continue-uri\\\" /* INVALID_CONTINUE_URI */]: 'The continue URL provided in the request is invalid.',\\r\\n        [\\\"invalid-cordova-configuration\\\" /* INVALID_CORDOVA_CONFIGURATION */]: 'The following Cordova plugins must be installed to enable OAuth sign-in: ' +\\r\\n            'cordova-plugin-buildinfo, cordova-universal-links-plugin, ' +\\r\\n            'cordova-plugin-browsertab, cordova-plugin-inappbrowser and ' +\\r\\n            'cordova-plugin-customurlscheme.',\\r\\n        [\\\"invalid-custom-token\\\" /* INVALID_CUSTOM_TOKEN */]: 'The custom token format is incorrect. Please check the documentation.',\\r\\n        [\\\"invalid-dynamic-link-domain\\\" /* INVALID_DYNAMIC_LINK_DOMAIN */]: 'The provided dynamic link domain is not configured or authorized for the current project.',\\r\\n        [\\\"invalid-email\\\" /* INVALID_EMAIL */]: 'The email address is badly formatted.',\\r\\n        [\\\"invalid-emulator-scheme\\\" /* INVALID_EMULATOR_SCHEME */]: 'Emulator URL must start with a valid scheme (http:// or https://).',\\r\\n        [\\\"invalid-api-key\\\" /* INVALID_API_KEY */]: 'Your API key is invalid, please check you have copied it correctly.',\\r\\n        [\\\"invalid-cert-hash\\\" /* INVALID_CERT_HASH */]: 'The SHA-1 certificate hash provided is invalid.',\\r\\n        [\\\"invalid-credential\\\" /* INVALID_IDP_RESPONSE */]: 'The supplied auth credential is malformed or has expired.',\\r\\n        [\\\"invalid-message-payload\\\" /* INVALID_MESSAGE_PAYLOAD */]: 'The email template corresponding to this action contains invalid characters in its message. ' +\\r\\n            'Please fix by going to the Auth email templates section in the Firebase Console.',\\r\\n        [\\\"invalid-multi-factor-session\\\" /* INVALID_MFA_SESSION */]: 'The request does not contain a valid proof of first factor successful sign-in.',\\r\\n        [\\\"invalid-oauth-provider\\\" /* INVALID_OAUTH_PROVIDER */]: 'EmailAuthProvider is not supported for this operation. This operation ' +\\r\\n            'only supports OAuth providers.',\\r\\n        [\\\"invalid-oauth-client-id\\\" /* INVALID_OAUTH_CLIENT_ID */]: 'The OAuth client ID provided is either invalid or does not match the ' +\\r\\n            'specified API key.',\\r\\n        [\\\"unauthorized-domain\\\" /* INVALID_ORIGIN */]: 'This domain is not authorized for OAuth operations for your Firebase ' +\\r\\n            'project. Edit the list of authorized domains from the Firebase console.',\\r\\n        [\\\"invalid-action-code\\\" /* INVALID_OOB_CODE */]: 'The action code is invalid. This can happen if the code is malformed, ' +\\r\\n            'expired, or has already been used.',\\r\\n        [\\\"wrong-password\\\" /* INVALID_PASSWORD */]: 'The password is invalid or the user does not have a password.',\\r\\n        [\\\"invalid-persistence-type\\\" /* INVALID_PERSISTENCE */]: 'The specified persistence type is invalid. It can only be local, session or none.',\\r\\n        [\\\"invalid-phone-number\\\" /* INVALID_PHONE_NUMBER */]: 'The format of the phone number provided is incorrect. Please enter the ' +\\r\\n            'phone number in a format that can be parsed into E.164 format. E.164 ' +\\r\\n            'phone numbers are written in the format [+][country code][subscriber ' +\\r\\n            'number including area code].',\\r\\n        [\\\"invalid-provider-id\\\" /* INVALID_PROVIDER_ID */]: 'The specified provider ID is invalid.',\\r\\n        [\\\"invalid-recipient-email\\\" /* INVALID_RECIPIENT_EMAIL */]: 'The email corresponding to this action failed to send as the provided ' +\\r\\n            'recipient email address is invalid.',\\r\\n        [\\\"invalid-sender\\\" /* INVALID_SENDER */]: 'The email template corresponding to this action contains an invalid sender email or name. ' +\\r\\n            'Please fix by going to the Auth email templates section in the Firebase Console.',\\r\\n        [\\\"invalid-verification-id\\\" /* INVALID_SESSION_INFO */]: 'The verification ID used to create the phone auth credential is invalid.',\\r\\n        [\\\"invalid-tenant-id\\\" /* INVALID_TENANT_ID */]: \\\"The Auth instance's tenant ID is invalid.\\\",\\r\\n        [\\\"login-blocked\\\" /* LOGIN_BLOCKED */]: \\\"Login blocked by user-provided method: {$originalMessage}\\\",\\r\\n        [\\\"missing-android-pkg-name\\\" /* MISSING_ANDROID_PACKAGE_NAME */]: 'An Android Package Name must be provided if the Android App is required to be installed.',\\r\\n        [\\\"auth-domain-config-required\\\" /* MISSING_AUTH_DOMAIN */]: 'Be sure to include authDomain when calling firebase.initializeApp(), ' +\\r\\n            'by following the instructions in the Firebase console.',\\r\\n        [\\\"missing-app-credential\\\" /* MISSING_APP_CREDENTIAL */]: 'The phone verification request is missing an application verifier ' +\\r\\n            'assertion. A reCAPTCHA response token needs to be provided.',\\r\\n        [\\\"missing-verification-code\\\" /* MISSING_CODE */]: 'The phone auth credential was created with an empty SMS verification code.',\\r\\n        [\\\"missing-continue-uri\\\" /* MISSING_CONTINUE_URI */]: 'A continue URL must be provided in the request.',\\r\\n        [\\\"missing-iframe-start\\\" /* MISSING_IFRAME_START */]: 'An internal AuthError has occurred.',\\r\\n        [\\\"missing-ios-bundle-id\\\" /* MISSING_IOS_BUNDLE_ID */]: 'An iOS Bundle ID must be provided if an App Store ID is provided.',\\r\\n        [\\\"missing-or-invalid-nonce\\\" /* MISSING_OR_INVALID_NONCE */]: 'The request does not contain a valid nonce. This can occur if the ' +\\r\\n            'SHA-256 hash of the provided raw nonce does not match the hashed nonce ' +\\r\\n            'in the ID token payload.',\\r\\n        [\\\"missing-multi-factor-info\\\" /* MISSING_MFA_INFO */]: 'No second factor identifier is provided.',\\r\\n        [\\\"missing-multi-factor-session\\\" /* MISSING_MFA_SESSION */]: 'The request is missing proof of first factor successful sign-in.',\\r\\n        [\\\"missing-phone-number\\\" /* MISSING_PHONE_NUMBER */]: 'To send verification codes, provide a phone number for the recipient.',\\r\\n        [\\\"missing-verification-id\\\" /* MISSING_SESSION_INFO */]: 'The phone auth credential was created with an empty verification ID.',\\r\\n        [\\\"app-deleted\\\" /* MODULE_DESTROYED */]: 'This instance of FirebaseApp has been deleted.',\\r\\n        [\\\"multi-factor-info-not-found\\\" /* MFA_INFO_NOT_FOUND */]: 'The user does not have a second factor matching the identifier provided.',\\r\\n        [\\\"multi-factor-auth-required\\\" /* MFA_REQUIRED */]: 'Proof of ownership of a second factor is required to complete sign-in.',\\r\\n        [\\\"account-exists-with-different-credential\\\" /* NEED_CONFIRMATION */]: 'An account already exists with the same email address but different ' +\\r\\n            'sign-in credentials. Sign in using a provider associated with this ' +\\r\\n            'email address.',\\r\\n        [\\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */]: 'A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.',\\r\\n        [\\\"no-auth-event\\\" /* NO_AUTH_EVENT */]: 'An internal AuthError has occurred.',\\r\\n        [\\\"no-such-provider\\\" /* NO_SUCH_PROVIDER */]: 'User was not linked to an account with the given provider.',\\r\\n        [\\\"null-user\\\" /* NULL_USER */]: 'A null user object was provided as the argument for an operation which ' +\\r\\n            'requires a non-null user object.',\\r\\n        [\\\"operation-not-allowed\\\" /* OPERATION_NOT_ALLOWED */]: 'The given sign-in provider is disabled for this Firebase project. ' +\\r\\n            'Enable it in the Firebase console, under the sign-in method tab of the ' +\\r\\n            'Auth section.',\\r\\n        [\\\"operation-not-supported-in-this-environment\\\" /* OPERATION_NOT_SUPPORTED */]: 'This operation is not supported in the environment this application is ' +\\r\\n            'running on. \\\"location.protocol\\\" must be http, https or chrome-extension' +\\r\\n            ' and web storage must be enabled.',\\r\\n        [\\\"popup-blocked\\\" /* POPUP_BLOCKED */]: 'Unable to establish a connection with the popup. It may have been blocked by the browser.',\\r\\n        [\\\"popup-closed-by-user\\\" /* POPUP_CLOSED_BY_USER */]: 'The popup has been closed by the user before finalizing the operation.',\\r\\n        [\\\"provider-already-linked\\\" /* PROVIDER_ALREADY_LINKED */]: 'User can only be linked to one identity for the given provider.',\\r\\n        [\\\"quota-exceeded\\\" /* QUOTA_EXCEEDED */]: \\\"The project's quota for this operation has been exceeded.\\\",\\r\\n        [\\\"redirect-cancelled-by-user\\\" /* REDIRECT_CANCELLED_BY_USER */]: 'The redirect operation has been cancelled by the user before finalizing.',\\r\\n        [\\\"redirect-operation-pending\\\" /* REDIRECT_OPERATION_PENDING */]: 'A redirect sign-in operation is already pending.',\\r\\n        [\\\"rejected-credential\\\" /* REJECTED_CREDENTIAL */]: 'The request contains malformed or mismatching credentials.',\\r\\n        [\\\"second-factor-already-in-use\\\" /* SECOND_FACTOR_ALREADY_ENROLLED */]: 'The second factor is already enrolled on this account.',\\r\\n        [\\\"maximum-second-factor-count-exceeded\\\" /* SECOND_FACTOR_LIMIT_EXCEEDED */]: 'The maximum allowed number of second factors on a user has been exceeded.',\\r\\n        [\\\"tenant-id-mismatch\\\" /* TENANT_ID_MISMATCH */]: \\\"The provided tenant ID does not match the Auth instance's tenant ID\\\",\\r\\n        [\\\"timeout\\\" /* TIMEOUT */]: 'The operation has timed out.',\\r\\n        [\\\"user-token-expired\\\" /* TOKEN_EXPIRED */]: \\\"The user's credential is no longer valid. The user must sign in again.\\\",\\r\\n        [\\\"too-many-requests\\\" /* TOO_MANY_ATTEMPTS_TRY_LATER */]: 'We have blocked all requests from this device due to unusual activity. ' +\\r\\n            'Try again later.',\\r\\n        [\\\"unauthorized-continue-uri\\\" /* UNAUTHORIZED_DOMAIN */]: 'The domain of the continue URL is not whitelisted.  Please whitelist ' +\\r\\n            'the domain in the Firebase console.',\\r\\n        [\\\"unsupported-first-factor\\\" /* UNSUPPORTED_FIRST_FACTOR */]: 'Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.',\\r\\n        [\\\"unsupported-persistence-type\\\" /* UNSUPPORTED_PERSISTENCE */]: 'The current environment does not support the specified persistence type.',\\r\\n        [\\\"unsupported-tenant-operation\\\" /* UNSUPPORTED_TENANT_OPERATION */]: 'This operation is not supported in a multi-tenant context.',\\r\\n        [\\\"unverified-email\\\" /* UNVERIFIED_EMAIL */]: 'The operation requires a verified email.',\\r\\n        [\\\"user-cancelled\\\" /* USER_CANCELLED */]: 'The user did not grant your application the permissions it requested.',\\r\\n        [\\\"user-not-found\\\" /* USER_DELETED */]: 'There is no user record corresponding to this identifier. The user may ' +\\r\\n            'have been deleted.',\\r\\n        [\\\"user-disabled\\\" /* USER_DISABLED */]: 'The user account has been disabled by an administrator.',\\r\\n        [\\\"user-mismatch\\\" /* USER_MISMATCH */]: 'The supplied credentials do not correspond to the previously signed in user.',\\r\\n        [\\\"user-signed-out\\\" /* USER_SIGNED_OUT */]: '',\\r\\n        [\\\"weak-password\\\" /* WEAK_PASSWORD */]: 'The password must be 6 characters long or more.',\\r\\n        [\\\"web-storage-unsupported\\\" /* WEB_STORAGE_UNSUPPORTED */]: 'This browser is not supported or 3rd party cookies and data may be disabled.',\\r\\n        [\\\"already-initialized\\\" /* ALREADY_INITIALIZED */]: 'initializeAuth() has already been called with ' +\\r\\n            'different options. To avoid this error, call initializeAuth() with the ' +\\r\\n            'same options as when it was originally called, or call getAuth() to return the' +\\r\\n            ' already initialized instance.'\\r\\n    };\\r\\n}\\r\\nfunction _prodErrorMap() {\\r\\n    // We will include this one message in the prod error map since by the very\\r\\n    // nature of this error, developers will never be able to see the message\\r\\n    // using the debugErrorMap (which is installed during auth initialization).\\r\\n    return {\\r\\n        [\\\"dependent-sdk-initialized-before-auth\\\" /* DEPENDENT_SDK_INIT_BEFORE_AUTH */]: 'Another Firebase SDK was initialized and is trying to use Auth before Auth is ' +\\r\\n            'initialized. Please be sure to call `initializeAuth` or `getAuth` before ' +\\r\\n            'starting any other Firebase SDK.'\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * A verbose error map with detailed descriptions for most error codes.\\r\\n *\\r\\n * See discussion at {@link AuthErrorMap}\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst debugErrorMap = _debugErrorMap;\\r\\n/**\\r\\n * A minimal error map with all verbose error messages stripped.\\r\\n *\\r\\n * See discussion at {@link AuthErrorMap}\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst prodErrorMap = _prodErrorMap;\\r\\nconst _DEFAULT_AUTH_ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.ErrorFactory('auth', 'Firebase', _prodErrorMap());\\r\\n/**\\r\\n * A map of potential `Auth` error codes, for easier comparison with errors\\r\\n * thrown by the SDK.\\r\\n *\\r\\n * @remarks\\r\\n * Note that you can't tree-shake individual keys\\r\\n * in the map, so by using the map you might substantially increase your\\r\\n * bundle size.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = {\\r\\n    ADMIN_ONLY_OPERATION: 'auth/admin-restricted-operation',\\r\\n    ARGUMENT_ERROR: 'auth/argument-error',\\r\\n    APP_NOT_AUTHORIZED: 'auth/app-not-authorized',\\r\\n    APP_NOT_INSTALLED: 'auth/app-not-installed',\\r\\n    CAPTCHA_CHECK_FAILED: 'auth/captcha-check-failed',\\r\\n    CODE_EXPIRED: 'auth/code-expired',\\r\\n    CORDOVA_NOT_READY: 'auth/cordova-not-ready',\\r\\n    CORS_UNSUPPORTED: 'auth/cors-unsupported',\\r\\n    CREDENTIAL_ALREADY_IN_USE: 'auth/credential-already-in-use',\\r\\n    CREDENTIAL_MISMATCH: 'auth/custom-token-mismatch',\\r\\n    CREDENTIAL_TOO_OLD_LOGIN_AGAIN: 'auth/requires-recent-login',\\r\\n    DEPENDENT_SDK_INIT_BEFORE_AUTH: 'auth/dependent-sdk-initialized-before-auth',\\r\\n    DYNAMIC_LINK_NOT_ACTIVATED: 'auth/dynamic-link-not-activated',\\r\\n    EMAIL_CHANGE_NEEDS_VERIFICATION: 'auth/email-change-needs-verification',\\r\\n    EMAIL_EXISTS: 'auth/email-already-in-use',\\r\\n    EMULATOR_CONFIG_FAILED: 'auth/emulator-config-failed',\\r\\n    EXPIRED_OOB_CODE: 'auth/expired-action-code',\\r\\n    EXPIRED_POPUP_REQUEST: 'auth/cancelled-popup-request',\\r\\n    INTERNAL_ERROR: 'auth/internal-error',\\r\\n    INVALID_API_KEY: 'auth/invalid-api-key',\\r\\n    INVALID_APP_CREDENTIAL: 'auth/invalid-app-credential',\\r\\n    INVALID_APP_ID: 'auth/invalid-app-id',\\r\\n    INVALID_AUTH: 'auth/invalid-user-token',\\r\\n    INVALID_AUTH_EVENT: 'auth/invalid-auth-event',\\r\\n    INVALID_CERT_HASH: 'auth/invalid-cert-hash',\\r\\n    INVALID_CODE: 'auth/invalid-verification-code',\\r\\n    INVALID_CONTINUE_URI: 'auth/invalid-continue-uri',\\r\\n    INVALID_CORDOVA_CONFIGURATION: 'auth/invalid-cordova-configuration',\\r\\n    INVALID_CUSTOM_TOKEN: 'auth/invalid-custom-token',\\r\\n    INVALID_DYNAMIC_LINK_DOMAIN: 'auth/invalid-dynamic-link-domain',\\r\\n    INVALID_EMAIL: 'auth/invalid-email',\\r\\n    INVALID_EMULATOR_SCHEME: 'auth/invalid-emulator-scheme',\\r\\n    INVALID_IDP_RESPONSE: 'auth/invalid-credential',\\r\\n    INVALID_MESSAGE_PAYLOAD: 'auth/invalid-message-payload',\\r\\n    INVALID_MFA_SESSION: 'auth/invalid-multi-factor-session',\\r\\n    INVALID_OAUTH_CLIENT_ID: 'auth/invalid-oauth-client-id',\\r\\n    INVALID_OAUTH_PROVIDER: 'auth/invalid-oauth-provider',\\r\\n    INVALID_OOB_CODE: 'auth/invalid-action-code',\\r\\n    INVALID_ORIGIN: 'auth/unauthorized-domain',\\r\\n    INVALID_PASSWORD: 'auth/wrong-password',\\r\\n    INVALID_PERSISTENCE: 'auth/invalid-persistence-type',\\r\\n    INVALID_PHONE_NUMBER: 'auth/invalid-phone-number',\\r\\n    INVALID_PROVIDER_ID: 'auth/invalid-provider-id',\\r\\n    INVALID_RECIPIENT_EMAIL: 'auth/invalid-recipient-email',\\r\\n    INVALID_SENDER: 'auth/invalid-sender',\\r\\n    INVALID_SESSION_INFO: 'auth/invalid-verification-id',\\r\\n    INVALID_TENANT_ID: 'auth/invalid-tenant-id',\\r\\n    MFA_INFO_NOT_FOUND: 'auth/multi-factor-info-not-found',\\r\\n    MFA_REQUIRED: 'auth/multi-factor-auth-required',\\r\\n    MISSING_ANDROID_PACKAGE_NAME: 'auth/missing-android-pkg-name',\\r\\n    MISSING_APP_CREDENTIAL: 'auth/missing-app-credential',\\r\\n    MISSING_AUTH_DOMAIN: 'auth/auth-domain-config-required',\\r\\n    MISSING_CODE: 'auth/missing-verification-code',\\r\\n    MISSING_CONTINUE_URI: 'auth/missing-continue-uri',\\r\\n    MISSING_IFRAME_START: 'auth/missing-iframe-start',\\r\\n    MISSING_IOS_BUNDLE_ID: 'auth/missing-ios-bundle-id',\\r\\n    MISSING_OR_INVALID_NONCE: 'auth/missing-or-invalid-nonce',\\r\\n    MISSING_MFA_INFO: 'auth/missing-multi-factor-info',\\r\\n    MISSING_MFA_SESSION: 'auth/missing-multi-factor-session',\\r\\n    MISSING_PHONE_NUMBER: 'auth/missing-phone-number',\\r\\n    MISSING_SESSION_INFO: 'auth/missing-verification-id',\\r\\n    MODULE_DESTROYED: 'auth/app-deleted',\\r\\n    NEED_CONFIRMATION: 'auth/account-exists-with-different-credential',\\r\\n    NETWORK_REQUEST_FAILED: 'auth/network-request-failed',\\r\\n    NULL_USER: 'auth/null-user',\\r\\n    NO_AUTH_EVENT: 'auth/no-auth-event',\\r\\n    NO_SUCH_PROVIDER: 'auth/no-such-provider',\\r\\n    OPERATION_NOT_ALLOWED: 'auth/operation-not-allowed',\\r\\n    OPERATION_NOT_SUPPORTED: 'auth/operation-not-supported-in-this-environment',\\r\\n    POPUP_BLOCKED: 'auth/popup-blocked',\\r\\n    POPUP_CLOSED_BY_USER: 'auth/popup-closed-by-user',\\r\\n    PROVIDER_ALREADY_LINKED: 'auth/provider-already-linked',\\r\\n    QUOTA_EXCEEDED: 'auth/quota-exceeded',\\r\\n    REDIRECT_CANCELLED_BY_USER: 'auth/redirect-cancelled-by-user',\\r\\n    REDIRECT_OPERATION_PENDING: 'auth/redirect-operation-pending',\\r\\n    REJECTED_CREDENTIAL: 'auth/rejected-credential',\\r\\n    SECOND_FACTOR_ALREADY_ENROLLED: 'auth/second-factor-already-in-use',\\r\\n    SECOND_FACTOR_LIMIT_EXCEEDED: 'auth/maximum-second-factor-count-exceeded',\\r\\n    TENANT_ID_MISMATCH: 'auth/tenant-id-mismatch',\\r\\n    TIMEOUT: 'auth/timeout',\\r\\n    TOKEN_EXPIRED: 'auth/user-token-expired',\\r\\n    TOO_MANY_ATTEMPTS_TRY_LATER: 'auth/too-many-requests',\\r\\n    UNAUTHORIZED_DOMAIN: 'auth/unauthorized-continue-uri',\\r\\n    UNSUPPORTED_FIRST_FACTOR: 'auth/unsupported-first-factor',\\r\\n    UNSUPPORTED_PERSISTENCE: 'auth/unsupported-persistence-type',\\r\\n    UNSUPPORTED_TENANT_OPERATION: 'auth/unsupported-tenant-operation',\\r\\n    UNVERIFIED_EMAIL: 'auth/unverified-email',\\r\\n    USER_CANCELLED: 'auth/user-cancelled',\\r\\n    USER_DELETED: 'auth/user-not-found',\\r\\n    USER_DISABLED: 'auth/user-disabled',\\r\\n    USER_MISMATCH: 'auth/user-mismatch',\\r\\n    USER_SIGNED_OUT: 'auth/user-signed-out',\\r\\n    WEAK_PASSWORD: 'auth/weak-password',\\r\\n    WEB_STORAGE_UNSUPPORTED: 'auth/web-storage-unsupported',\\r\\n    ALREADY_INITIALIZED: 'auth/already-initialized'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logClient = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger('@firebase/auth');\\r\\nfunction _logError(msg, ...args) {\\r\\n    if (logClient.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\r\\n        logClient.error(`Auth (${_firebase_app__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION}): ${msg}`, ...args);\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _fail(authOrCode, ...rest) {\\r\\n    throw createErrorInternal(authOrCode, ...rest);\\r\\n}\\r\\nfunction _createError(authOrCode, ...rest) {\\r\\n    return createErrorInternal(authOrCode, ...rest);\\r\\n}\\r\\nfunction _errorWithCustomMessage(auth, code, message) {\\r\\n    const errorMap = Object.assign(Object.assign({}, prodErrorMap()), { [code]: message });\\r\\n    const factory = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.ErrorFactory('auth', 'Firebase', errorMap);\\r\\n    return factory.create(code, {\\r\\n        appName: auth.name,\\r\\n    });\\r\\n}\\r\\nfunction _assertInstanceOf(auth, object, instance) {\\r\\n    const constructorInstance = instance;\\r\\n    if (!(object instanceof constructorInstance)) {\\r\\n        if (constructorInstance.name !== object.constructor.name) {\\r\\n            _fail(auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        }\\r\\n        throw _errorWithCustomMessage(auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */, `Type of ${object.constructor.name} does not match expected instance.` +\\r\\n            `Did you pass a reference from a different Auth SDK?`);\\r\\n    }\\r\\n}\\r\\nfunction createErrorInternal(authOrCode, ...rest) {\\r\\n    if (typeof authOrCode !== 'string') {\\r\\n        const code = rest[0];\\r\\n        const fullParams = [...rest.slice(1)];\\r\\n        if (fullParams[0]) {\\r\\n            fullParams[0].appName = authOrCode.name;\\r\\n        }\\r\\n        return authOrCode._errorFactory.create(code, ...fullParams);\\r\\n    }\\r\\n    return _DEFAULT_AUTH_ERROR_FACTORY.create(authOrCode, ...rest);\\r\\n}\\r\\nfunction _assert(assertion, authOrCode, ...rest) {\\r\\n    if (!assertion) {\\r\\n        throw createErrorInternal(authOrCode, ...rest);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Unconditionally fails, throwing an internal error with the given message.\\r\\n *\\r\\n * @param failure type of failure encountered\\r\\n * @throws Error\\r\\n */\\r\\nfunction debugFail(failure) {\\r\\n    // Log the failure in addition to throw an exception, just in case the\\r\\n    // exception is swallowed.\\r\\n    const message = `INTERNAL ASSERTION FAILED: ` + failure;\\r\\n    _logError(message);\\r\\n    // NOTE: We don't use FirebaseError here because these are internal failures\\r\\n    // that cannot be handled by the user. (Also it would create a circular\\r\\n    // dependency between the error and assert modules which doesn't work.)\\r\\n    throw new Error(message);\\r\\n}\\r\\n/**\\r\\n * Fails if the given assertion condition is false, throwing an Error with the\\r\\n * given message if it did.\\r\\n *\\r\\n * @param assertion\\r\\n * @param message\\r\\n */\\r\\nfunction debugAssert(assertion, message) {\\r\\n    if (!assertion) {\\r\\n        debugFail(message);\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst instanceCache = new Map();\\r\\nfunction _getInstance(cls) {\\r\\n    debugAssert(cls instanceof Function, 'Expected a class definition');\\r\\n    let instance = instanceCache.get(cls);\\r\\n    if (instance) {\\r\\n        debugAssert(instance instanceof cls, 'Instance stored in cache mismatched with class');\\r\\n        return instance;\\r\\n    }\\r\\n    instance = new cls();\\r\\n    instanceCache.set(cls, instance);\\r\\n    return instance;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Initializes an {@link Auth} instance with fine-grained control over\\r\\n * {@link Dependencies}.\\r\\n *\\r\\n * @remarks\\r\\n *\\r\\n * This function allows more control over the {@link Auth} instance than\\r\\n * {@link getAuth}. `getAuth` uses platform-specific defaults to supply\\r\\n * the {@link Dependencies}. In general, `getAuth` is the easiest way to\\r\\n * initialize Auth and works for most use cases. Use `initializeAuth` if you\\r\\n * need control over which persistence layer is used, or to minimize bundle\\r\\n * size if you're not using either `signInWithPopup` or `signInWithRedirect`.\\r\\n *\\r\\n * For example, if your app only uses anonymous accounts and you only want\\r\\n * accounts saved for the current session, initialize `Auth` with:\\r\\n *\\r\\n * ```js\\r\\n * const auth = initializeAuth(app, {\\r\\n *   persistence: browserSessionPersistence,\\r\\n *   popupRedirectResolver: undefined,\\r\\n * });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction initializeAuth(app, deps) {\\r\\n    const provider = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__._getProvider)(app, 'auth');\\r\\n    if (provider.isInitialized()) {\\r\\n        const auth = provider.getImmediate();\\r\\n        const initialOptions = provider.getOptions();\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.deepEqual)(initialOptions, deps !== null && deps !== void 0 ? deps : {})) {\\r\\n            return auth;\\r\\n        }\\r\\n        else {\\r\\n            _fail(auth, \\\"already-initialized\\\" /* ALREADY_INITIALIZED */);\\r\\n        }\\r\\n    }\\r\\n    const auth = provider.initialize({ options: deps });\\r\\n    return auth;\\r\\n}\\r\\nfunction _initializeAuthInstance(auth, deps) {\\r\\n    const persistence = (deps === null || deps === void 0 ? void 0 : deps.persistence) || [];\\r\\n    const hierarchy = (Array.isArray(persistence) ? persistence : [persistence]).map(_getInstance);\\r\\n    if (deps === null || deps === void 0 ? void 0 : deps.errorMap) {\\r\\n        auth._updateErrorMap(deps.errorMap);\\r\\n    }\\r\\n    // This promise is intended to float; auth initialization happens in the\\r\\n    // background, meanwhile the auth object may be used by the app.\\r\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n    auth._initializeWithPersistence(hierarchy, deps === null || deps === void 0 ? void 0 : deps.popupRedirectResolver);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _getCurrentUrl() {\\r\\n    var _a;\\r\\n    return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.href)) || '';\\r\\n}\\r\\nfunction _isHttpOrHttps() {\\r\\n    return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';\\r\\n}\\r\\nfunction _getCurrentScheme() {\\r\\n    var _a;\\r\\n    return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.protocol)) || null;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Determine whether the browser is working online\\r\\n */\\r\\nfunction _isOnline() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        navigator &&\\r\\n        'onLine' in navigator &&\\r\\n        typeof navigator.onLine === 'boolean' &&\\r\\n        // Apply only for traditional web apps and Chrome extensions.\\r\\n        // This is especially true for Cordova apps which have unreliable\\r\\n        // navigator.onLine behavior unless cordova-plugin-network-information is\\r\\n        // installed which overwrites the native navigator.onLine value and\\r\\n        // defines navigator.connection.\\r\\n        (_isHttpOrHttps() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.isBrowserExtension)() || 'connection' in navigator)) {\\r\\n        return navigator.onLine;\\r\\n    }\\r\\n    // If we can't determine the state, assume it is online.\\r\\n    return true;\\r\\n}\\r\\nfunction _getUserLanguage() {\\r\\n    if (typeof navigator === 'undefined') {\\r\\n        return null;\\r\\n    }\\r\\n    const navigatorLanguage = navigator;\\r\\n    return (\\r\\n    // Most reliable, but only supported in Chrome/Firefox.\\r\\n    (navigatorLanguage.languages && navigatorLanguage.languages[0]) ||\\r\\n        // Supported in most browsers, but returns the language of the browser\\r\\n        // UI, not the language set in browser settings.\\r\\n        navigatorLanguage.language ||\\r\\n        // Couldn't determine language.\\r\\n        null);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A structure to help pick between a range of long and short delay durations\\r\\n * depending on the current environment. In general, the long delay is used for\\r\\n * mobile environments whereas short delays are used for desktop environments.\\r\\n */\\r\\nclass Delay {\\r\\n    constructor(shortDelay, longDelay) {\\r\\n        this.shortDelay = shortDelay;\\r\\n        this.longDelay = longDelay;\\r\\n        // Internal error when improperly initialized.\\r\\n        debugAssert(longDelay > shortDelay, 'Short delay should be less than long delay!');\\r\\n        this.isMobile = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.isReactNative)();\\r\\n    }\\r\\n    get() {\\r\\n        if (!_isOnline()) {\\r\\n            // Pick the shorter timeout.\\r\\n            return Math.min(5000 /* OFFLINE */, this.shortDelay);\\r\\n        }\\r\\n        // If running in a mobile environment, return the long delay, otherwise\\r\\n        // return the short delay.\\r\\n        // This could be improved in the future to dynamically change based on other\\r\\n        // variables instead of just reading the current environment.\\r\\n        return this.isMobile ? this.longDelay : this.shortDelay;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _emulatorUrl(config, path) {\\r\\n    debugAssert(config.emulator, 'Emulator should always be set here');\\r\\n    const { url } = config.emulator;\\r\\n    if (!path) {\\r\\n        return url;\\r\\n    }\\r\\n    return `${url}${path.startsWith('/') ? path.slice(1) : path}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FetchProvider {\\r\\n    static initialize(fetchImpl, headersImpl, responseImpl) {\\r\\n        this.fetchImpl = fetchImpl;\\r\\n        if (headersImpl) {\\r\\n            this.headersImpl = headersImpl;\\r\\n        }\\r\\n        if (responseImpl) {\\r\\n            this.responseImpl = responseImpl;\\r\\n        }\\r\\n    }\\r\\n    static fetch() {\\r\\n        if (this.fetchImpl) {\\r\\n            return this.fetchImpl;\\r\\n        }\\r\\n        if (typeof self !== 'undefined' && 'fetch' in self) {\\r\\n            return self.fetch;\\r\\n        }\\r\\n        debugFail('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');\\r\\n    }\\r\\n    static headers() {\\r\\n        if (this.headersImpl) {\\r\\n            return this.headersImpl;\\r\\n        }\\r\\n        if (typeof self !== 'undefined' && 'Headers' in self) {\\r\\n            return self.Headers;\\r\\n        }\\r\\n        debugFail('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');\\r\\n    }\\r\\n    static response() {\\r\\n        if (this.responseImpl) {\\r\\n            return this.responseImpl;\\r\\n        }\\r\\n        if (typeof self !== 'undefined' && 'Response' in self) {\\r\\n            return self.Response;\\r\\n        }\\r\\n        debugFail('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Map from errors returned by the server to errors to developer visible errors\\r\\n */\\r\\nconst SERVER_ERROR_MAP = {\\r\\n    // Custom token errors.\\r\\n    [\\\"CREDENTIAL_MISMATCH\\\" /* CREDENTIAL_MISMATCH */]: \\\"custom-token-mismatch\\\" /* CREDENTIAL_MISMATCH */,\\r\\n    // This can only happen if the SDK sends a bad request.\\r\\n    [\\\"MISSING_CUSTOM_TOKEN\\\" /* MISSING_CUSTOM_TOKEN */]: \\\"internal-error\\\" /* INTERNAL_ERROR */,\\r\\n    // Create Auth URI errors.\\r\\n    [\\\"INVALID_IDENTIFIER\\\" /* INVALID_IDENTIFIER */]: \\\"invalid-email\\\" /* INVALID_EMAIL */,\\r\\n    // This can only happen if the SDK sends a bad request.\\r\\n    [\\\"MISSING_CONTINUE_URI\\\" /* MISSING_CONTINUE_URI */]: \\\"internal-error\\\" /* INTERNAL_ERROR */,\\r\\n    // Sign in with email and password errors (some apply to sign up too).\\r\\n    [\\\"INVALID_PASSWORD\\\" /* INVALID_PASSWORD */]: \\\"wrong-password\\\" /* INVALID_PASSWORD */,\\r\\n    // This can only happen if the SDK sends a bad request.\\r\\n    [\\\"MISSING_PASSWORD\\\" /* MISSING_PASSWORD */]: \\\"internal-error\\\" /* INTERNAL_ERROR */,\\r\\n    // Sign up with email and password errors.\\r\\n    [\\\"EMAIL_EXISTS\\\" /* EMAIL_EXISTS */]: \\\"email-already-in-use\\\" /* EMAIL_EXISTS */,\\r\\n    [\\\"PASSWORD_LOGIN_DISABLED\\\" /* PASSWORD_LOGIN_DISABLED */]: \\\"operation-not-allowed\\\" /* OPERATION_NOT_ALLOWED */,\\r\\n    // Verify assertion for sign in with credential errors:\\r\\n    [\\\"INVALID_IDP_RESPONSE\\\" /* INVALID_IDP_RESPONSE */]: \\\"invalid-credential\\\" /* INVALID_IDP_RESPONSE */,\\r\\n    [\\\"INVALID_PENDING_TOKEN\\\" /* INVALID_PENDING_TOKEN */]: \\\"invalid-credential\\\" /* INVALID_IDP_RESPONSE */,\\r\\n    [\\\"FEDERATED_USER_ID_ALREADY_LINKED\\\" /* FEDERATED_USER_ID_ALREADY_LINKED */]: \\\"credential-already-in-use\\\" /* CREDENTIAL_ALREADY_IN_USE */,\\r\\n    // This can only happen if the SDK sends a bad request.\\r\\n    [\\\"MISSING_REQ_TYPE\\\" /* MISSING_REQ_TYPE */]: \\\"internal-error\\\" /* INTERNAL_ERROR */,\\r\\n    // Send Password reset email errors:\\r\\n    [\\\"EMAIL_NOT_FOUND\\\" /* EMAIL_NOT_FOUND */]: \\\"user-not-found\\\" /* USER_DELETED */,\\r\\n    [\\\"RESET_PASSWORD_EXCEED_LIMIT\\\" /* RESET_PASSWORD_EXCEED_LIMIT */]: \\\"too-many-requests\\\" /* TOO_MANY_ATTEMPTS_TRY_LATER */,\\r\\n    [\\\"EXPIRED_OOB_CODE\\\" /* EXPIRED_OOB_CODE */]: \\\"expired-action-code\\\" /* EXPIRED_OOB_CODE */,\\r\\n    [\\\"INVALID_OOB_CODE\\\" /* INVALID_OOB_CODE */]: \\\"invalid-action-code\\\" /* INVALID_OOB_CODE */,\\r\\n    // This can only happen if the SDK sends a bad request.\\r\\n    [\\\"MISSING_OOB_CODE\\\" /* MISSING_OOB_CODE */]: \\\"internal-error\\\" /* INTERNAL_ERROR */,\\r\\n    // Operations that require ID token in request:\\r\\n    [\\\"CREDENTIAL_TOO_OLD_LOGIN_AGAIN\\\" /* CREDENTIAL_TOO_OLD_LOGIN_AGAIN */]: \\\"requires-recent-login\\\" /* CREDENTIAL_TOO_OLD_LOGIN_AGAIN */,\\r\\n    [\\\"INVALID_ID_TOKEN\\\" /* INVALID_ID_TOKEN */]: \\\"invalid-user-token\\\" /* INVALID_AUTH */,\\r\\n    [\\\"TOKEN_EXPIRED\\\" /* TOKEN_EXPIRED */]: \\\"user-token-expired\\\" /* TOKEN_EXPIRED */,\\r\\n    [\\\"USER_NOT_FOUND\\\" /* USER_NOT_FOUND */]: \\\"user-token-expired\\\" /* TOKEN_EXPIRED */,\\r\\n    // Other errors.\\r\\n    [\\\"TOO_MANY_ATTEMPTS_TRY_LATER\\\" /* TOO_MANY_ATTEMPTS_TRY_LATER */]: \\\"too-many-requests\\\" /* TOO_MANY_ATTEMPTS_TRY_LATER */,\\r\\n    // Phone Auth related errors.\\r\\n    [\\\"INVALID_CODE\\\" /* INVALID_CODE */]: \\\"invalid-verification-code\\\" /* INVALID_CODE */,\\r\\n    [\\\"INVALID_SESSION_INFO\\\" /* INVALID_SESSION_INFO */]: \\\"invalid-verification-id\\\" /* INVALID_SESSION_INFO */,\\r\\n    [\\\"INVALID_TEMPORARY_PROOF\\\" /* INVALID_TEMPORARY_PROOF */]: \\\"invalid-credential\\\" /* INVALID_IDP_RESPONSE */,\\r\\n    [\\\"MISSING_SESSION_INFO\\\" /* MISSING_SESSION_INFO */]: \\\"missing-verification-id\\\" /* MISSING_SESSION_INFO */,\\r\\n    [\\\"SESSION_EXPIRED\\\" /* SESSION_EXPIRED */]: \\\"code-expired\\\" /* CODE_EXPIRED */,\\r\\n    // Other action code errors when additional settings passed.\\r\\n    // MISSING_CONTINUE_URI is getting mapped to INTERNAL_ERROR above.\\r\\n    // This is OK as this error will be caught by client side validation.\\r\\n    [\\\"MISSING_ANDROID_PACKAGE_NAME\\\" /* MISSING_ANDROID_PACKAGE_NAME */]: \\\"missing-android-pkg-name\\\" /* MISSING_ANDROID_PACKAGE_NAME */,\\r\\n    [\\\"UNAUTHORIZED_DOMAIN\\\" /* UNAUTHORIZED_DOMAIN */]: \\\"unauthorized-continue-uri\\\" /* UNAUTHORIZED_DOMAIN */,\\r\\n    // getProjectConfig errors when clientId is passed.\\r\\n    [\\\"INVALID_OAUTH_CLIENT_ID\\\" /* INVALID_OAUTH_CLIENT_ID */]: \\\"invalid-oauth-client-id\\\" /* INVALID_OAUTH_CLIENT_ID */,\\r\\n    // User actions (sign-up or deletion) disabled errors.\\r\\n    [\\\"ADMIN_ONLY_OPERATION\\\" /* ADMIN_ONLY_OPERATION */]: \\\"admin-restricted-operation\\\" /* ADMIN_ONLY_OPERATION */,\\r\\n    // Multi factor related errors.\\r\\n    [\\\"INVALID_MFA_PENDING_CREDENTIAL\\\" /* INVALID_MFA_PENDING_CREDENTIAL */]: \\\"invalid-multi-factor-session\\\" /* INVALID_MFA_SESSION */,\\r\\n    [\\\"MFA_ENROLLMENT_NOT_FOUND\\\" /* MFA_ENROLLMENT_NOT_FOUND */]: \\\"multi-factor-info-not-found\\\" /* MFA_INFO_NOT_FOUND */,\\r\\n    [\\\"MISSING_MFA_ENROLLMENT_ID\\\" /* MISSING_MFA_ENROLLMENT_ID */]: \\\"missing-multi-factor-info\\\" /* MISSING_MFA_INFO */,\\r\\n    [\\\"MISSING_MFA_PENDING_CREDENTIAL\\\" /* MISSING_MFA_PENDING_CREDENTIAL */]: \\\"missing-multi-factor-session\\\" /* MISSING_MFA_SESSION */,\\r\\n    [\\\"SECOND_FACTOR_EXISTS\\\" /* SECOND_FACTOR_EXISTS */]: \\\"second-factor-already-in-use\\\" /* SECOND_FACTOR_ALREADY_ENROLLED */,\\r\\n    [\\\"SECOND_FACTOR_LIMIT_EXCEEDED\\\" /* SECOND_FACTOR_LIMIT_EXCEEDED */]: \\\"maximum-second-factor-count-exceeded\\\" /* SECOND_FACTOR_LIMIT_EXCEEDED */,\\r\\n    // Blocking functions related errors.\\r\\n    [\\\"BLOCKING_FUNCTION_ERROR_RESPONSE\\\" /* BLOCKING_FUNCTION_ERROR_RESPONSE */]: \\\"internal-error\\\" /* INTERNAL_ERROR */,\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_API_TIMEOUT_MS = new Delay(30000, 60000);\\r\\nfunction _addTidIfNecessary(auth, request) {\\r\\n    if (auth.tenantId && !request.tenantId) {\\r\\n        return Object.assign(Object.assign({}, request), { tenantId: auth.tenantId });\\r\\n    }\\r\\n    return request;\\r\\n}\\r\\nasync function _performApiRequest(auth, method, path, request, customErrorMap = {}) {\\r\\n    return _performFetchWithErrorHandling(auth, customErrorMap, async () => {\\r\\n        let body = {};\\r\\n        let params = {};\\r\\n        if (request) {\\r\\n            if (method === \\\"GET\\\" /* GET */) {\\r\\n                params = request;\\r\\n            }\\r\\n            else {\\r\\n                body = {\\r\\n                    body: JSON.stringify(request)\\r\\n                };\\r\\n            }\\r\\n        }\\r\\n        const query = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystring)(Object.assign({ key: auth.config.apiKey }, params)).slice(1);\\r\\n        const headers = await auth._getAdditionalHeaders();\\r\\n        headers[\\\"Content-Type\\\" /* CONTENT_TYPE */] = 'application/json';\\r\\n        if (auth.languageCode) {\\r\\n            headers[\\\"X-Firebase-Locale\\\" /* X_FIREBASE_LOCALE */] = auth.languageCode;\\r\\n        }\\r\\n        return FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), Object.assign({ method,\\r\\n            headers, referrerPolicy: 'no-referrer' }, body));\\r\\n    });\\r\\n}\\r\\nasync function _performFetchWithErrorHandling(auth, customErrorMap, fetchFn) {\\r\\n    auth._canInitEmulator = false;\\r\\n    const errorMap = Object.assign(Object.assign({}, SERVER_ERROR_MAP), customErrorMap);\\r\\n    try {\\r\\n        const networkTimeout = new NetworkTimeout(auth);\\r\\n        const response = await Promise.race([\\r\\n            fetchFn(),\\r\\n            networkTimeout.promise\\r\\n        ]);\\r\\n        // If we've reached this point, the fetch succeeded and the networkTimeout\\r\\n        // didn't throw; clear the network timeout delay so that Node won't hang\\r\\n        networkTimeout.clearNetworkTimeout();\\r\\n        const json = await response.json();\\r\\n        if ('needConfirmation' in json) {\\r\\n            throw _makeTaggedError(auth, \\\"account-exists-with-different-credential\\\" /* NEED_CONFIRMATION */, json);\\r\\n        }\\r\\n        if (response.ok && !('errorMessage' in json)) {\\r\\n            return json;\\r\\n        }\\r\\n        else {\\r\\n            const errorMessage = response.ok ? json.errorMessage : json.error.message;\\r\\n            const [serverErrorCode, serverErrorMessage] = errorMessage.split(' : ');\\r\\n            if (serverErrorCode === \\\"FEDERATED_USER_ID_ALREADY_LINKED\\\" /* FEDERATED_USER_ID_ALREADY_LINKED */) {\\r\\n                throw _makeTaggedError(auth, \\\"credential-already-in-use\\\" /* CREDENTIAL_ALREADY_IN_USE */, json);\\r\\n            }\\r\\n            else if (serverErrorCode === \\\"EMAIL_EXISTS\\\" /* EMAIL_EXISTS */) {\\r\\n                throw _makeTaggedError(auth, \\\"email-already-in-use\\\" /* EMAIL_EXISTS */, json);\\r\\n            }\\r\\n            const authError = errorMap[serverErrorCode] ||\\r\\n                serverErrorCode\\r\\n                    .toLowerCase()\\r\\n                    .replace(/[_\\\\s]+/g, '-');\\r\\n            if (serverErrorMessage) {\\r\\n                throw _errorWithCustomMessage(auth, authError, serverErrorMessage);\\r\\n            }\\r\\n            else {\\r\\n                _fail(auth, authError);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    catch (e) {\\r\\n        if (e instanceof _firebase_util__WEBPACK_IMPORTED_MODULE_0__.FirebaseError) {\\r\\n            throw e;\\r\\n        }\\r\\n        _fail(auth, \\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */);\\r\\n    }\\r\\n}\\r\\nasync function _performSignInRequest(auth, method, path, request, customErrorMap = {}) {\\r\\n    const serverResponse = (await _performApiRequest(auth, method, path, request, customErrorMap));\\r\\n    if ('mfaPendingCredential' in serverResponse) {\\r\\n        _fail(auth, \\\"multi-factor-auth-required\\\" /* MFA_REQUIRED */, {\\r\\n            _serverResponse: serverResponse\\r\\n        });\\r\\n    }\\r\\n    return serverResponse;\\r\\n}\\r\\nfunction _getFinalTarget(auth, host, path, query) {\\r\\n    const base = `${host}${path}?${query}`;\\r\\n    if (!auth.config.emulator) {\\r\\n        return `${auth.config.apiScheme}://${base}`;\\r\\n    }\\r\\n    return _emulatorUrl(auth.config, base);\\r\\n}\\r\\nclass NetworkTimeout {\\r\\n    constructor(auth) {\\r\\n        this.auth = auth;\\r\\n        // Node timers and browser timers are fundamentally incompatible, but we\\r\\n        // don't care about the value here\\r\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n        this.timer = null;\\r\\n        this.promise = new Promise((_, reject) => {\\r\\n            this.timer = setTimeout(() => {\\r\\n                return reject(_createError(this.auth, \\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */));\\r\\n            }, DEFAULT_API_TIMEOUT_MS.get());\\r\\n        });\\r\\n    }\\r\\n    clearNetworkTimeout() {\\r\\n        clearTimeout(this.timer);\\r\\n    }\\r\\n}\\r\\nfunction _makeTaggedError(auth, code, response) {\\r\\n    const errorParams = {\\r\\n        appName: auth.name\\r\\n    };\\r\\n    if (response.email) {\\r\\n        errorParams.email = response.email;\\r\\n    }\\r\\n    if (response.phoneNumber) {\\r\\n        errorParams.phoneNumber = response.phoneNumber;\\r\\n    }\\r\\n    const error = _createError(auth, code, errorParams);\\r\\n    // We know customData is defined on error because errorParams is defined\\r\\n    error.customData._tokenResponse = response;\\r\\n    return error;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function deleteAccount(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:delete\\\" /* DELETE_ACCOUNT */, request);\\r\\n}\\r\\nasync function deleteLinkedAccounts(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:update\\\" /* SET_ACCOUNT_INFO */, request);\\r\\n}\\r\\nasync function getAccountInfo(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:lookup\\\" /* GET_ACCOUNT_INFO */, request);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction utcTimestampToDateString(utcTimestamp) {\\r\\n    if (!utcTimestamp) {\\r\\n        return undefined;\\r\\n    }\\r\\n    try {\\r\\n        // Convert to date object.\\r\\n        const date = new Date(Number(utcTimestamp));\\r\\n        // Test date is valid.\\r\\n        if (!isNaN(date.getTime())) {\\r\\n            // Convert to UTC date string.\\r\\n            return date.toUTCString();\\r\\n        }\\r\\n    }\\r\\n    catch (e) {\\r\\n        // Do nothing. undefined will be returned.\\r\\n    }\\r\\n    return undefined;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a JSON Web Token (JWT) used to identify the user to a Firebase service.\\r\\n *\\r\\n * @remarks\\r\\n * Returns the current token if it has not expired or if it will not expire in the next five\\r\\n * minutes. Otherwise, this will refresh the token and return a new one.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param forceRefresh - Force refresh regardless of token expiration.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getIdToken(user, forceRefresh = false) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user).getIdToken(forceRefresh);\\r\\n}\\r\\n/**\\r\\n * Returns a deserialized JSON Web Token (JWT) used to identitfy the user to a Firebase service.\\r\\n *\\r\\n * @remarks\\r\\n * Returns the current token if it has not expired or if it will not expire in the next five\\r\\n * minutes. Otherwise, this will refresh the token and return a new one.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param forceRefresh - Force refresh regardless of token expiration.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function getIdTokenResult(user, forceRefresh = false) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    const token = await userInternal.getIdToken(forceRefresh);\\r\\n    const claims = _parseToken(token);\\r\\n    _assert(claims && claims.exp && claims.auth_time && claims.iat, userInternal.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    const firebase = typeof claims.firebase === 'object' ? claims.firebase : undefined;\\r\\n    const signInProvider = firebase === null || firebase === void 0 ? void 0 : firebase['sign_in_provider'];\\r\\n    return {\\r\\n        claims,\\r\\n        token,\\r\\n        authTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.auth_time)),\\r\\n        issuedAtTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.iat)),\\r\\n        expirationTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.exp)),\\r\\n        signInProvider: signInProvider || null,\\r\\n        signInSecondFactor: (firebase === null || firebase === void 0 ? void 0 : firebase['sign_in_second_factor']) || null\\r\\n    };\\r\\n}\\r\\nfunction secondsStringToMilliseconds(seconds) {\\r\\n    return Number(seconds) * 1000;\\r\\n}\\r\\nfunction _parseToken(token) {\\r\\n    const [algorithm, payload, signature] = token.split('.');\\r\\n    if (algorithm === undefined ||\\r\\n        payload === undefined ||\\r\\n        signature === undefined) {\\r\\n        _logError('JWT malformed, contained fewer than 3 sections');\\r\\n        return null;\\r\\n    }\\r\\n    try {\\r\\n        const decoded = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.base64Decode)(payload);\\r\\n        if (!decoded) {\\r\\n            _logError('Failed to decode base64 JWT payload');\\r\\n            return null;\\r\\n        }\\r\\n        return JSON.parse(decoded);\\r\\n    }\\r\\n    catch (e) {\\r\\n        _logError('Caught error parsing JWT payload as JSON', e);\\r\\n        return null;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Extract expiresIn TTL from a token by subtracting the expiration from the issuance.\\r\\n */\\r\\nfunction _tokenExpiresIn(token) {\\r\\n    const parsedToken = _parseToken(token);\\r\\n    _assert(parsedToken, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    _assert(typeof parsedToken.exp !== 'undefined', \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    _assert(typeof parsedToken.iat !== 'undefined', \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    return Number(parsedToken.exp) - Number(parsedToken.iat);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function _logoutIfInvalidated(user, promise, bypassAuthState = false) {\\r\\n    if (bypassAuthState) {\\r\\n        return promise;\\r\\n    }\\r\\n    try {\\r\\n        return await promise;\\r\\n    }\\r\\n    catch (e) {\\r\\n        if (e instanceof _firebase_util__WEBPACK_IMPORTED_MODULE_0__.FirebaseError && isUserInvalidated(e)) {\\r\\n            if (user.auth.currentUser === user) {\\r\\n                await user.auth.signOut();\\r\\n            }\\r\\n        }\\r\\n        throw e;\\r\\n    }\\r\\n}\\r\\nfunction isUserInvalidated({ code }) {\\r\\n    return (code === `auth/${\\\"user-disabled\\\" /* USER_DISABLED */}` ||\\r\\n        code === `auth/${\\\"user-token-expired\\\" /* TOKEN_EXPIRED */}`);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass ProactiveRefresh {\\r\\n    constructor(user) {\\r\\n        this.user = user;\\r\\n        this.isRunning = false;\\r\\n        // Node timers and browser timers return fundamentally different types.\\r\\n        // We don't actually care what the value is but TS won't accept unknown and\\r\\n        // we can't cast properly in both environments.\\r\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n        this.timerId = null;\\r\\n        this.errorBackoff = 30000 /* RETRY_BACKOFF_MIN */;\\r\\n    }\\r\\n    _start() {\\r\\n        if (this.isRunning) {\\r\\n            return;\\r\\n        }\\r\\n        this.isRunning = true;\\r\\n        this.schedule();\\r\\n    }\\r\\n    _stop() {\\r\\n        if (!this.isRunning) {\\r\\n            return;\\r\\n        }\\r\\n        this.isRunning = false;\\r\\n        if (this.timerId !== null) {\\r\\n            clearTimeout(this.timerId);\\r\\n        }\\r\\n    }\\r\\n    getInterval(wasError) {\\r\\n        var _a;\\r\\n        if (wasError) {\\r\\n            const interval = this.errorBackoff;\\r\\n            this.errorBackoff = Math.min(this.errorBackoff * 2, 960000 /* RETRY_BACKOFF_MAX */);\\r\\n            return interval;\\r\\n        }\\r\\n        else {\\r\\n            // Reset the error backoff\\r\\n            this.errorBackoff = 30000 /* RETRY_BACKOFF_MIN */;\\r\\n            const expTime = (_a = this.user.stsTokenManager.expirationTime) !== null && _a !== void 0 ? _a : 0;\\r\\n            const interval = expTime - Date.now() - 300000 /* OFFSET */;\\r\\n            return Math.max(0, interval);\\r\\n        }\\r\\n    }\\r\\n    schedule(wasError = false) {\\r\\n        if (!this.isRunning) {\\r\\n            // Just in case...\\r\\n            return;\\r\\n        }\\r\\n        const interval = this.getInterval(wasError);\\r\\n        this.timerId = setTimeout(async () => {\\r\\n            await this.iteration();\\r\\n        }, interval);\\r\\n    }\\r\\n    async iteration() {\\r\\n        try {\\r\\n            await this.user.getIdToken(true);\\r\\n        }\\r\\n        catch (e) {\\r\\n            // Only retry on network errors\\r\\n            if (e.code === `auth/${\\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */}`) {\\r\\n                this.schedule(/* wasError */ true);\\r\\n            }\\r\\n            return;\\r\\n        }\\r\\n        this.schedule();\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass UserMetadata {\\r\\n    constructor(createdAt, lastLoginAt) {\\r\\n        this.createdAt = createdAt;\\r\\n        this.lastLoginAt = lastLoginAt;\\r\\n        this._initializeTime();\\r\\n    }\\r\\n    _initializeTime() {\\r\\n        this.lastSignInTime = utcTimestampToDateString(this.lastLoginAt);\\r\\n        this.creationTime = utcTimestampToDateString(this.createdAt);\\r\\n    }\\r\\n    _copy(metadata) {\\r\\n        this.createdAt = metadata.createdAt;\\r\\n        this.lastLoginAt = metadata.lastLoginAt;\\r\\n        this._initializeTime();\\r\\n    }\\r\\n    toJSON() {\\r\\n        return {\\r\\n            createdAt: this.createdAt,\\r\\n            lastLoginAt: this.lastLoginAt\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function _reloadWithoutSaving(user) {\\r\\n    var _a;\\r\\n    const auth = user.auth;\\r\\n    const idToken = await user.getIdToken();\\r\\n    const response = await _logoutIfInvalidated(user, getAccountInfo(auth, { idToken }));\\r\\n    _assert(response === null || response === void 0 ? void 0 : response.users.length, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    const coreAccount = response.users[0];\\r\\n    user._notifyReloadListener(coreAccount);\\r\\n    const newProviderData = ((_a = coreAccount.providerUserInfo) === null || _a === void 0 ? void 0 : _a.length)\\r\\n        ? extractProviderData(coreAccount.providerUserInfo)\\r\\n        : [];\\r\\n    const providerData = mergeProviderData(user.providerData, newProviderData);\\r\\n    // Preserves the non-nonymous status of the stored user, even if no more\\r\\n    // credentials (federated or email/password) are linked to the user. If\\r\\n    // the user was previously anonymous, then use provider data to update.\\r\\n    // On the other hand, if it was not anonymous before, it should never be\\r\\n    // considered anonymous now.\\r\\n    const oldIsAnonymous = user.isAnonymous;\\r\\n    const newIsAnonymous = !(user.email && coreAccount.passwordHash) && !(providerData === null || providerData === void 0 ? void 0 : providerData.length);\\r\\n    const isAnonymous = !oldIsAnonymous ? false : newIsAnonymous;\\r\\n    const updates = {\\r\\n        uid: coreAccount.localId,\\r\\n        displayName: coreAccount.displayName || null,\\r\\n        photoURL: coreAccount.photoUrl || null,\\r\\n        email: coreAccount.email || null,\\r\\n        emailVerified: coreAccount.emailVerified || false,\\r\\n        phoneNumber: coreAccount.phoneNumber || null,\\r\\n        tenantId: coreAccount.tenantId || null,\\r\\n        providerData,\\r\\n        metadata: new UserMetadata(coreAccount.createdAt, coreAccount.lastLoginAt),\\r\\n        isAnonymous\\r\\n    };\\r\\n    Object.assign(user, updates);\\r\\n}\\r\\n/**\\r\\n * Reloads user account data, if signed in.\\r\\n *\\r\\n * @param user - The user.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function reload(user) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    await _reloadWithoutSaving(userInternal);\\r\\n    // Even though the current user hasn't changed, update\\r\\n    // current user will trigger a persistence update w/ the\\r\\n    // new info.\\r\\n    await userInternal.auth._persistUserIfCurrent(userInternal);\\r\\n    userInternal.auth._notifyListenersIfCurrent(userInternal);\\r\\n}\\r\\nfunction mergeProviderData(original, newData) {\\r\\n    const deduped = original.filter(o => !newData.some(n => n.providerId === o.providerId));\\r\\n    return [...deduped, ...newData];\\r\\n}\\r\\nfunction extractProviderData(providers) {\\r\\n    return providers.map((_a) => {\\r\\n        var { providerId } = _a, provider = (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__rest)(_a, [\\\"providerId\\\"]);\\r\\n        return {\\r\\n            providerId,\\r\\n            uid: provider.rawId || '',\\r\\n            displayName: provider.displayName || null,\\r\\n            email: provider.email || null,\\r\\n            phoneNumber: provider.phoneNumber || null,\\r\\n            photoURL: provider.photoUrl || null\\r\\n        };\\r\\n    });\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function requestStsToken(auth, refreshToken) {\\r\\n    const response = await _performFetchWithErrorHandling(auth, {}, async () => {\\r\\n        const body = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystring)({\\r\\n            'grant_type': 'refresh_token',\\r\\n            'refresh_token': refreshToken\\r\\n        }).slice(1);\\r\\n        const { tokenApiHost, apiKey } = auth.config;\\r\\n        const url = _getFinalTarget(auth, tokenApiHost, \\\"/v1/token\\\" /* TOKEN */, `key=${apiKey}`);\\r\\n        const headers = await auth._getAdditionalHeaders();\\r\\n        headers[\\\"Content-Type\\\" /* CONTENT_TYPE */] = 'application/x-www-form-urlencoded';\\r\\n        return FetchProvider.fetch()(url, {\\r\\n            method: \\\"POST\\\" /* POST */,\\r\\n            headers,\\r\\n            body\\r\\n        });\\r\\n    });\\r\\n    // The response comes back in snake_case. Convert to camel:\\r\\n    return {\\r\\n        accessToken: response.access_token,\\r\\n        expiresIn: response.expires_in,\\r\\n        refreshToken: response.refresh_token\\r\\n    };\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * We need to mark this class as internal explicitly to exclude it in the public typings, because\\r\\n * it references AuthInternal which has a circular dependency with UserInternal.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nclass StsTokenManager {\\r\\n    constructor() {\\r\\n        this.refreshToken = null;\\r\\n        this.accessToken = null;\\r\\n        this.expirationTime = null;\\r\\n    }\\r\\n    get isExpired() {\\r\\n        return (!this.expirationTime ||\\r\\n            Date.now() > this.expirationTime - 30000 /* TOKEN_REFRESH */);\\r\\n    }\\r\\n    updateFromServerResponse(response) {\\r\\n        _assert(response.idToken, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        _assert(typeof response.idToken !== 'undefined', \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        _assert(typeof response.refreshToken !== 'undefined', \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        const expiresIn = 'expiresIn' in response && typeof response.expiresIn !== 'undefined'\\r\\n            ? Number(response.expiresIn)\\r\\n            : _tokenExpiresIn(response.idToken);\\r\\n        this.updateTokensAndExpiration(response.idToken, response.refreshToken, expiresIn);\\r\\n    }\\r\\n    async getToken(auth, forceRefresh = false) {\\r\\n        _assert(!this.accessToken || this.refreshToken, auth, \\\"user-token-expired\\\" /* TOKEN_EXPIRED */);\\r\\n        if (!forceRefresh && this.accessToken && !this.isExpired) {\\r\\n            return this.accessToken;\\r\\n        }\\r\\n        if (this.refreshToken) {\\r\\n            await this.refresh(auth, this.refreshToken);\\r\\n            return this.accessToken;\\r\\n        }\\r\\n        return null;\\r\\n    }\\r\\n    clearRefreshToken() {\\r\\n        this.refreshToken = null;\\r\\n    }\\r\\n    async refresh(auth, oldToken) {\\r\\n        const { accessToken, refreshToken, expiresIn } = await requestStsToken(auth, oldToken);\\r\\n        this.updateTokensAndExpiration(accessToken, refreshToken, Number(expiresIn));\\r\\n    }\\r\\n    updateTokensAndExpiration(accessToken, refreshToken, expiresInSec) {\\r\\n        this.refreshToken = refreshToken || null;\\r\\n        this.accessToken = accessToken || null;\\r\\n        this.expirationTime = Date.now() + expiresInSec * 1000;\\r\\n    }\\r\\n    static fromJSON(appName, object) {\\r\\n        const { refreshToken, accessToken, expirationTime } = object;\\r\\n        const manager = new StsTokenManager();\\r\\n        if (refreshToken) {\\r\\n            _assert(typeof refreshToken === 'string', \\\"internal-error\\\" /* INTERNAL_ERROR */, {\\r\\n                appName\\r\\n            });\\r\\n            manager.refreshToken = refreshToken;\\r\\n        }\\r\\n        if (accessToken) {\\r\\n            _assert(typeof accessToken === 'string', \\\"internal-error\\\" /* INTERNAL_ERROR */, {\\r\\n                appName\\r\\n            });\\r\\n            manager.accessToken = accessToken;\\r\\n        }\\r\\n        if (expirationTime) {\\r\\n            _assert(typeof expirationTime === 'number', \\\"internal-error\\\" /* INTERNAL_ERROR */, {\\r\\n                appName\\r\\n            });\\r\\n            manager.expirationTime = expirationTime;\\r\\n        }\\r\\n        return manager;\\r\\n    }\\r\\n    toJSON() {\\r\\n        return {\\r\\n            refreshToken: this.refreshToken,\\r\\n            accessToken: this.accessToken,\\r\\n            expirationTime: this.expirationTime\\r\\n        };\\r\\n    }\\r\\n    _assign(stsTokenManager) {\\r\\n        this.accessToken = stsTokenManager.accessToken;\\r\\n        this.refreshToken = stsTokenManager.refreshToken;\\r\\n        this.expirationTime = stsTokenManager.expirationTime;\\r\\n    }\\r\\n    _clone() {\\r\\n        return Object.assign(new StsTokenManager(), this.toJSON());\\r\\n    }\\r\\n    _performRefresh() {\\r\\n        return debugFail('not implemented');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction assertStringOrUndefined(assertion, appName) {\\r\\n    _assert(typeof assertion === 'string' || typeof assertion === 'undefined', \\\"internal-error\\\" /* INTERNAL_ERROR */, { appName });\\r\\n}\\r\\nclass UserImpl {\\r\\n    constructor(_a) {\\r\\n        var { uid, auth, stsTokenManager } = _a, opt = (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__rest)(_a, [\\\"uid\\\", \\\"auth\\\", \\\"stsTokenManager\\\"]);\\r\\n        // For the user object, provider is always Firebase.\\r\\n        this.providerId = \\\"firebase\\\" /* FIREBASE */;\\r\\n        this.proactiveRefresh = new ProactiveRefresh(this);\\r\\n        this.reloadUserInfo = null;\\r\\n        this.reloadListener = null;\\r\\n        this.uid = uid;\\r\\n        this.auth = auth;\\r\\n        this.stsTokenManager = stsTokenManager;\\r\\n        this.accessToken = stsTokenManager.accessToken;\\r\\n        this.displayName = opt.displayName || null;\\r\\n        this.email = opt.email || null;\\r\\n        this.emailVerified = opt.emailVerified || false;\\r\\n        this.phoneNumber = opt.phoneNumber || null;\\r\\n        this.photoURL = opt.photoURL || null;\\r\\n        this.isAnonymous = opt.isAnonymous || false;\\r\\n        this.tenantId = opt.tenantId || null;\\r\\n        this.providerData = opt.providerData ? [...opt.providerData] : [];\\r\\n        this.metadata = new UserMetadata(opt.createdAt || undefined, opt.lastLoginAt || undefined);\\r\\n    }\\r\\n    async getIdToken(forceRefresh) {\\r\\n        const accessToken = await _logoutIfInvalidated(this, this.stsTokenManager.getToken(this.auth, forceRefresh));\\r\\n        _assert(accessToken, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        if (this.accessToken !== accessToken) {\\r\\n            this.accessToken = accessToken;\\r\\n            await this.auth._persistUserIfCurrent(this);\\r\\n            this.auth._notifyListenersIfCurrent(this);\\r\\n        }\\r\\n        return accessToken;\\r\\n    }\\r\\n    getIdTokenResult(forceRefresh) {\\r\\n        return getIdTokenResult(this, forceRefresh);\\r\\n    }\\r\\n    reload() {\\r\\n        return reload(this);\\r\\n    }\\r\\n    _assign(user) {\\r\\n        if (this === user) {\\r\\n            return;\\r\\n        }\\r\\n        _assert(this.uid === user.uid, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        this.displayName = user.displayName;\\r\\n        this.photoURL = user.photoURL;\\r\\n        this.email = user.email;\\r\\n        this.emailVerified = user.emailVerified;\\r\\n        this.phoneNumber = user.phoneNumber;\\r\\n        this.isAnonymous = user.isAnonymous;\\r\\n        this.tenantId = user.tenantId;\\r\\n        this.providerData = user.providerData.map(userInfo => (Object.assign({}, userInfo)));\\r\\n        this.metadata._copy(user.metadata);\\r\\n        this.stsTokenManager._assign(user.stsTokenManager);\\r\\n    }\\r\\n    _clone(auth) {\\r\\n        return new UserImpl(Object.assign(Object.assign({}, this), { auth, stsTokenManager: this.stsTokenManager._clone() }));\\r\\n    }\\r\\n    _onReload(callback) {\\r\\n        // There should only ever be one listener, and that is a single instance of MultiFactorUser\\r\\n        _assert(!this.reloadListener, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        this.reloadListener = callback;\\r\\n        if (this.reloadUserInfo) {\\r\\n            this._notifyReloadListener(this.reloadUserInfo);\\r\\n            this.reloadUserInfo = null;\\r\\n        }\\r\\n    }\\r\\n    _notifyReloadListener(userInfo) {\\r\\n        if (this.reloadListener) {\\r\\n            this.reloadListener(userInfo);\\r\\n        }\\r\\n        else {\\r\\n            // If no listener is subscribed yet, save the result so it's available when they do subscribe\\r\\n            this.reloadUserInfo = userInfo;\\r\\n        }\\r\\n    }\\r\\n    _startProactiveRefresh() {\\r\\n        this.proactiveRefresh._start();\\r\\n    }\\r\\n    _stopProactiveRefresh() {\\r\\n        this.proactiveRefresh._stop();\\r\\n    }\\r\\n    async _updateTokensIfNecessary(response, reload = false) {\\r\\n        let tokensRefreshed = false;\\r\\n        if (response.idToken &&\\r\\n            response.idToken !== this.stsTokenManager.accessToken) {\\r\\n            this.stsTokenManager.updateFromServerResponse(response);\\r\\n            tokensRefreshed = true;\\r\\n        }\\r\\n        if (reload) {\\r\\n            await _reloadWithoutSaving(this);\\r\\n        }\\r\\n        await this.auth._persistUserIfCurrent(this);\\r\\n        if (tokensRefreshed) {\\r\\n            this.auth._notifyListenersIfCurrent(this);\\r\\n        }\\r\\n    }\\r\\n    async delete() {\\r\\n        const idToken = await this.getIdToken();\\r\\n        await _logoutIfInvalidated(this, deleteAccount(this.auth, { idToken }));\\r\\n        this.stsTokenManager.clearRefreshToken();\\r\\n        // TODO: Determine if cancellable-promises are necessary to use in this class so that delete()\\r\\n        //       cancels pending actions...\\r\\n        return this.auth.signOut();\\r\\n    }\\r\\n    toJSON() {\\r\\n        return Object.assign(Object.assign({ uid: this.uid, email: this.email || undefined, emailVerified: this.emailVerified, displayName: this.displayName || undefined, isAnonymous: this.isAnonymous, photoURL: this.photoURL || undefined, phoneNumber: this.phoneNumber || undefined, tenantId: this.tenantId || undefined, providerData: this.providerData.map(userInfo => (Object.assign({}, userInfo))), stsTokenManager: this.stsTokenManager.toJSON(), \\r\\n            // Redirect event ID must be maintained in case there is a pending\\r\\n            // redirect event.\\r\\n            _redirectEventId: this._redirectEventId }, this.metadata.toJSON()), { \\r\\n            // Required for compatibility with the legacy SDK (go/firebase-auth-sdk-persistence-parsing):\\r\\n            apiKey: this.auth.config.apiKey, appName: this.auth.name });\\r\\n    }\\r\\n    get refreshToken() {\\r\\n        return this.stsTokenManager.refreshToken || '';\\r\\n    }\\r\\n    static _fromJSON(auth, object) {\\r\\n        var _a, _b, _c, _d, _e, _f, _g, _h;\\r\\n        const displayName = (_a = object.displayName) !== null && _a !== void 0 ? _a : undefined;\\r\\n        const email = (_b = object.email) !== null && _b !== void 0 ? _b : undefined;\\r\\n        const phoneNumber = (_c = object.phoneNumber) !== null && _c !== void 0 ? _c : undefined;\\r\\n        const photoURL = (_d = object.photoURL) !== null && _d !== void 0 ? _d : undefined;\\r\\n        const tenantId = (_e = object.tenantId) !== null && _e !== void 0 ? _e : undefined;\\r\\n        const _redirectEventId = (_f = object._redirectEventId) !== null && _f !== void 0 ? _f : undefined;\\r\\n        const createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;\\r\\n        const lastLoginAt = (_h = object.lastLoginAt) !== null && _h !== void 0 ? _h : undefined;\\r\\n        const { uid, emailVerified, isAnonymous, providerData, stsTokenManager: plainObjectTokenManager } = object;\\r\\n        _assert(uid && plainObjectTokenManager, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        const stsTokenManager = StsTokenManager.fromJSON(this.name, plainObjectTokenManager);\\r\\n        _assert(typeof uid === 'string', auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        assertStringOrUndefined(displayName, auth.name);\\r\\n        assertStringOrUndefined(email, auth.name);\\r\\n        _assert(typeof emailVerified === 'boolean', auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        _assert(typeof isAnonymous === 'boolean', auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        assertStringOrUndefined(phoneNumber, auth.name);\\r\\n        assertStringOrUndefined(photoURL, auth.name);\\r\\n        assertStringOrUndefined(tenantId, auth.name);\\r\\n        assertStringOrUndefined(_redirectEventId, auth.name);\\r\\n        assertStringOrUndefined(createdAt, auth.name);\\r\\n        assertStringOrUndefined(lastLoginAt, auth.name);\\r\\n        const user = new UserImpl({\\r\\n            uid,\\r\\n            auth,\\r\\n            email,\\r\\n            emailVerified,\\r\\n            displayName,\\r\\n            isAnonymous,\\r\\n            photoURL,\\r\\n            phoneNumber,\\r\\n            tenantId,\\r\\n            stsTokenManager,\\r\\n            createdAt,\\r\\n            lastLoginAt\\r\\n        });\\r\\n        if (providerData && Array.isArray(providerData)) {\\r\\n            user.providerData = providerData.map(userInfo => (Object.assign({}, userInfo)));\\r\\n        }\\r\\n        if (_redirectEventId) {\\r\\n            user._redirectEventId = _redirectEventId;\\r\\n        }\\r\\n        return user;\\r\\n    }\\r\\n    /**\\r\\n     * Initialize a User from an idToken server response\\r\\n     * @param auth\\r\\n     * @param idTokenResponse\\r\\n     */\\r\\n    static async _fromIdTokenResponse(auth, idTokenResponse, isAnonymous = false) {\\r\\n        const stsTokenManager = new StsTokenManager();\\r\\n        stsTokenManager.updateFromServerResponse(idTokenResponse);\\r\\n        // Initialize the Firebase Auth user.\\r\\n        const user = new UserImpl({\\r\\n            uid: idTokenResponse.localId,\\r\\n            auth,\\r\\n            stsTokenManager,\\r\\n            isAnonymous\\r\\n        });\\r\\n        // Updates the user info and data and resolves with a user instance.\\r\\n        await _reloadWithoutSaving(user);\\r\\n        return user;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass InMemoryPersistence {\\r\\n    constructor() {\\r\\n        this.type = \\\"NONE\\\" /* NONE */;\\r\\n        this.storage = {};\\r\\n    }\\r\\n    async _isAvailable() {\\r\\n        return true;\\r\\n    }\\r\\n    async _set(key, value) {\\r\\n        this.storage[key] = value;\\r\\n    }\\r\\n    async _get(key) {\\r\\n        const value = this.storage[key];\\r\\n        return value === undefined ? null : value;\\r\\n    }\\r\\n    async _remove(key) {\\r\\n        delete this.storage[key];\\r\\n    }\\r\\n    _addListener(_key, _listener) {\\r\\n        // Listeners are not supported for in-memory storage since it cannot be shared across windows/workers\\r\\n        return;\\r\\n    }\\r\\n    _removeListener(_key, _listener) {\\r\\n        // Listeners are not supported for in-memory storage since it cannot be shared across windows/workers\\r\\n        return;\\r\\n    }\\r\\n}\\r\\nInMemoryPersistence.type = 'NONE';\\r\\n/**\\r\\n * An implementation of {@link Persistence} of type 'NONE'.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst inMemoryPersistence = InMemoryPersistence;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _persistenceKeyName(key, apiKey, appName) {\\r\\n    return `${\\\"firebase\\\" /* PERSISTENCE */}:${key}:${apiKey}:${appName}`;\\r\\n}\\r\\nclass PersistenceUserManager {\\r\\n    constructor(persistence, auth, userKey) {\\r\\n        this.persistence = persistence;\\r\\n        this.auth = auth;\\r\\n        this.userKey = userKey;\\r\\n        const { config, name } = this.auth;\\r\\n        this.fullUserKey = _persistenceKeyName(this.userKey, config.apiKey, name);\\r\\n        this.fullPersistenceKey = _persistenceKeyName(\\\"persistence\\\" /* PERSISTENCE_USER */, config.apiKey, name);\\r\\n        this.boundEventHandler = auth._onStorageEvent.bind(auth);\\r\\n        this.persistence._addListener(this.fullUserKey, this.boundEventHandler);\\r\\n    }\\r\\n    setCurrentUser(user) {\\r\\n        return this.persistence._set(this.fullUserKey, user.toJSON());\\r\\n    }\\r\\n    async getCurrentUser() {\\r\\n        const blob = await this.persistence._get(this.fullUserKey);\\r\\n        return blob ? UserImpl._fromJSON(this.auth, blob) : null;\\r\\n    }\\r\\n    removeCurrentUser() {\\r\\n        return this.persistence._remove(this.fullUserKey);\\r\\n    }\\r\\n    savePersistenceForRedirect() {\\r\\n        return this.persistence._set(this.fullPersistenceKey, this.persistence.type);\\r\\n    }\\r\\n    async setPersistence(newPersistence) {\\r\\n        if (this.persistence === newPersistence) {\\r\\n            return;\\r\\n        }\\r\\n        const currentUser = await this.getCurrentUser();\\r\\n        await this.removeCurrentUser();\\r\\n        this.persistence = newPersistence;\\r\\n        if (currentUser) {\\r\\n            return this.setCurrentUser(currentUser);\\r\\n        }\\r\\n    }\\r\\n    delete() {\\r\\n        this.persistence._removeListener(this.fullUserKey, this.boundEventHandler);\\r\\n    }\\r\\n    static async create(auth, persistenceHierarchy, userKey = \\\"authUser\\\" /* AUTH_USER */) {\\r\\n        if (!persistenceHierarchy.length) {\\r\\n            return new PersistenceUserManager(_getInstance(inMemoryPersistence), auth, userKey);\\r\\n        }\\r\\n        // Eliminate any persistences that are not available\\r\\n        const availablePersistences = (await Promise.all(persistenceHierarchy.map(async (persistence) => {\\r\\n            if (await persistence._isAvailable()) {\\r\\n                return persistence;\\r\\n            }\\r\\n            return undefined;\\r\\n        }))).filter(persistence => persistence);\\r\\n        // Fall back to the first persistence listed, or in memory if none available\\r\\n        let selectedPersistence = availablePersistences[0] ||\\r\\n            _getInstance(inMemoryPersistence);\\r\\n        const key = _persistenceKeyName(userKey, auth.config.apiKey, auth.name);\\r\\n        // Pull out the existing user, setting the chosen persistence to that\\r\\n        // persistence if the user exists.\\r\\n        let userToMigrate = null;\\r\\n        // Note, here we check for a user in _all_ persistences, not just the\\r\\n        // ones deemed available. If we can migrate a user out of a broken\\r\\n        // persistence, we will (but only if that persistence supports migration).\\r\\n        for (const persistence of persistenceHierarchy) {\\r\\n            try {\\r\\n                const blob = await persistence._get(key);\\r\\n                if (blob) {\\r\\n                    const user = UserImpl._fromJSON(auth, blob); // throws for unparsable blob (wrong format)\\r\\n                    if (persistence !== selectedPersistence) {\\r\\n                        userToMigrate = user;\\r\\n                    }\\r\\n                    selectedPersistence = persistence;\\r\\n                    break;\\r\\n                }\\r\\n            }\\r\\n            catch (_a) { }\\r\\n        }\\r\\n        // If we find the user in a persistence that does support migration, use\\r\\n        // that migration path (of only persistences that support migration)\\r\\n        const migrationHierarchy = availablePersistences.filter(p => p._shouldAllowMigration);\\r\\n        // If the persistence does _not_ allow migration, just finish off here\\r\\n        if (!selectedPersistence._shouldAllowMigration ||\\r\\n            !migrationHierarchy.length) {\\r\\n            return new PersistenceUserManager(selectedPersistence, auth, userKey);\\r\\n        }\\r\\n        selectedPersistence = migrationHierarchy[0];\\r\\n        if (userToMigrate) {\\r\\n            // This normally shouldn't throw since chosenPersistence.isAvailable() is true, but if it does\\r\\n            // we'll just let it bubble to surface the error.\\r\\n            await selectedPersistence._set(key, userToMigrate.toJSON());\\r\\n        }\\r\\n        // Attempt to clear the key in other persistences but ignore errors. This helps prevent issues\\r\\n        // such as users getting stuck with a previous account after signing out and refreshing the tab.\\r\\n        await Promise.all(persistenceHierarchy.map(async (persistence) => {\\r\\n            if (persistence !== selectedPersistence) {\\r\\n                try {\\r\\n                    await persistence._remove(key);\\r\\n                }\\r\\n                catch (_a) { }\\r\\n            }\\r\\n        }));\\r\\n        return new PersistenceUserManager(selectedPersistence, auth, userKey);\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Determine the browser for the purposes of reporting usage to the API\\r\\n */\\r\\nfunction _getBrowserName(userAgent) {\\r\\n    const ua = userAgent.toLowerCase();\\r\\n    if (ua.includes('opera/') || ua.includes('opr/') || ua.includes('opios/')) {\\r\\n        return \\\"Opera\\\" /* OPERA */;\\r\\n    }\\r\\n    else if (_isIEMobile(ua)) {\\r\\n        // Windows phone IEMobile browser.\\r\\n        return \\\"IEMobile\\\" /* IEMOBILE */;\\r\\n    }\\r\\n    else if (ua.includes('msie') || ua.includes('trident/')) {\\r\\n        return \\\"IE\\\" /* IE */;\\r\\n    }\\r\\n    else if (ua.includes('edge/')) {\\r\\n        return \\\"Edge\\\" /* EDGE */;\\r\\n    }\\r\\n    else if (_isFirefox(ua)) {\\r\\n        return \\\"Firefox\\\" /* FIREFOX */;\\r\\n    }\\r\\n    else if (ua.includes('silk/')) {\\r\\n        return \\\"Silk\\\" /* SILK */;\\r\\n    }\\r\\n    else if (_isBlackBerry(ua)) {\\r\\n        // Blackberry browser.\\r\\n        return \\\"Blackberry\\\" /* BLACKBERRY */;\\r\\n    }\\r\\n    else if (_isWebOS(ua)) {\\r\\n        // WebOS default browser.\\r\\n        return \\\"Webos\\\" /* WEBOS */;\\r\\n    }\\r\\n    else if (_isSafari(ua)) {\\r\\n        return \\\"Safari\\\" /* SAFARI */;\\r\\n    }\\r\\n    else if ((ua.includes('chrome/') || _isChromeIOS(ua)) &&\\r\\n        !ua.includes('edge/')) {\\r\\n        return \\\"Chrome\\\" /* CHROME */;\\r\\n    }\\r\\n    else if (_isAndroid(ua)) {\\r\\n        // Android stock browser.\\r\\n        return \\\"Android\\\" /* ANDROID */;\\r\\n    }\\r\\n    else {\\r\\n        // Most modern browsers have name/version at end of user agent string.\\r\\n        const re = /([a-zA-Z\\\\d\\\\.]+)\\\\/[a-zA-Z\\\\d\\\\.]*$/;\\r\\n        const matches = userAgent.match(re);\\r\\n        if ((matches === null || matches === void 0 ? void 0 : matches.length) === 2) {\\r\\n            return matches[1];\\r\\n        }\\r\\n    }\\r\\n    return \\\"Other\\\" /* OTHER */;\\r\\n}\\r\\nfunction _isFirefox(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /firefox\\\\//i.test(ua);\\r\\n}\\r\\nfunction _isSafari(userAgent = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    const ua = userAgent.toLowerCase();\\r\\n    return (ua.includes('safari/') &&\\r\\n        !ua.includes('chrome/') &&\\r\\n        !ua.includes('crios/') &&\\r\\n        !ua.includes('android'));\\r\\n}\\r\\nfunction _isChromeIOS(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /crios\\\\//i.test(ua);\\r\\n}\\r\\nfunction _isIEMobile(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /iemobile/i.test(ua);\\r\\n}\\r\\nfunction _isAndroid(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /android/i.test(ua);\\r\\n}\\r\\nfunction _isBlackBerry(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /blackberry/i.test(ua);\\r\\n}\\r\\nfunction _isWebOS(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /webos/i.test(ua);\\r\\n}\\r\\nfunction _isIOS(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return /iphone|ipad|ipod/i.test(ua);\\r\\n}\\r\\nfunction _isIOS7Or8(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    return (/(iPad|iPhone|iPod).*OS 7_\\\\d/i.test(ua) ||\\r\\n        /(iPad|iPhone|iPod).*OS 8_\\\\d/i.test(ua));\\r\\n}\\r\\nfunction _isIOSStandalone(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    var _a;\\r\\n    return _isIOS(ua) && !!((_a = window.navigator) === null || _a === void 0 ? void 0 : _a.standalone);\\r\\n}\\r\\nfunction _isIE10() {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.isIE)() && document.documentMode === 10;\\r\\n}\\r\\nfunction _isMobileBrowser(ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)()) {\\r\\n    // TODO: implement getBrowserName equivalent for OS.\\r\\n    return (_isIOS(ua) ||\\r\\n        _isAndroid(ua) ||\\r\\n        _isWebOS(ua) ||\\r\\n        _isBlackBerry(ua) ||\\r\\n        /windows phone/i.test(ua) ||\\r\\n        _isIEMobile(ua));\\r\\n}\\r\\nfunction _isIframe() {\\r\\n    try {\\r\\n        // Check that the current window is not the top window.\\r\\n        // If so, return true.\\r\\n        return !!(window && window !== window.top);\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/*\\r\\n * Determine the SDK version string\\r\\n */\\r\\nfunction _getClientVersion(clientPlatform, frameworks = []) {\\r\\n    let reportedPlatform;\\r\\n    switch (clientPlatform) {\\r\\n        case \\\"Browser\\\" /* BROWSER */:\\r\\n            // In a browser environment, report the browser name.\\r\\n            reportedPlatform = _getBrowserName((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)());\\r\\n            break;\\r\\n        case \\\"Worker\\\" /* WORKER */:\\r\\n            // Technically a worker runs from a browser but we need to differentiate a\\r\\n            // worker from a browser.\\r\\n            // For example: Chrome-Worker/JsCore/4.9.1/FirebaseCore-web.\\r\\n            reportedPlatform = `${_getBrowserName((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)())}-${clientPlatform}`;\\r\\n            break;\\r\\n        default:\\r\\n            reportedPlatform = clientPlatform;\\r\\n    }\\r\\n    const reportedFrameworks = frameworks.length\\r\\n        ? frameworks.join(',')\\r\\n        : 'FirebaseCore-web'; /* default value if no other framework is used */\\r\\n    return `${reportedPlatform}/${\\\"JsCore\\\" /* CORE */}/${_firebase_app__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION}/${reportedFrameworks}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2022 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass AuthMiddlewareQueue {\\r\\n    constructor(auth) {\\r\\n        this.auth = auth;\\r\\n        this.queue = [];\\r\\n    }\\r\\n    pushCallback(callback, onAbort) {\\r\\n        // The callback could be sync or async. Wrap it into a\\r\\n        // function that is always async.\\r\\n        const wrappedCallback = (user) => new Promise((resolve, reject) => {\\r\\n            try {\\r\\n                const result = callback(user);\\r\\n                // Either resolve with existing promise or wrap a non-promise\\r\\n                // return value into a promise.\\r\\n                resolve(result);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // Sync callback throws.\\r\\n                reject(e);\\r\\n            }\\r\\n        });\\r\\n        // Attach the onAbort if present\\r\\n        wrappedCallback.onAbort = onAbort;\\r\\n        this.queue.push(wrappedCallback);\\r\\n        const index = this.queue.length - 1;\\r\\n        return () => {\\r\\n            // Unsubscribe. Replace with no-op. Do not remove from array, or it will disturb\\r\\n            // indexing of other elements.\\r\\n            this.queue[index] = () => Promise.resolve();\\r\\n        };\\r\\n    }\\r\\n    async runMiddleware(nextUser) {\\r\\n        if (this.auth.currentUser === nextUser) {\\r\\n            return;\\r\\n        }\\r\\n        // While running the middleware, build a temporary stack of onAbort\\r\\n        // callbacks to call if one middleware callback rejects.\\r\\n        const onAbortStack = [];\\r\\n        try {\\r\\n            for (const beforeStateCallback of this.queue) {\\r\\n                await beforeStateCallback(nextUser);\\r\\n                // Only push the onAbort if the callback succeeds\\r\\n                if (beforeStateCallback.onAbort) {\\r\\n                    onAbortStack.push(beforeStateCallback.onAbort);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        catch (e) {\\r\\n            // Run all onAbort, with separate try/catch to ignore any errors and\\r\\n            // continue\\r\\n            onAbortStack.reverse();\\r\\n            for (const onAbort of onAbortStack) {\\r\\n                try {\\r\\n                    onAbort();\\r\\n                }\\r\\n                catch (_) { /* swallow error */ }\\r\\n            }\\r\\n            throw this.auth._errorFactory.create(\\\"login-blocked\\\" /* LOGIN_BLOCKED */, { originalMessage: e.message });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass AuthImpl {\\r\\n    constructor(app, heartbeatServiceProvider, config) {\\r\\n        this.app = app;\\r\\n        this.heartbeatServiceProvider = heartbeatServiceProvider;\\r\\n        this.config = config;\\r\\n        this.currentUser = null;\\r\\n        this.emulatorConfig = null;\\r\\n        this.operations = Promise.resolve();\\r\\n        this.authStateSubscription = new Subscription(this);\\r\\n        this.idTokenSubscription = new Subscription(this);\\r\\n        this.beforeStateQueue = new AuthMiddlewareQueue(this);\\r\\n        this.redirectUser = null;\\r\\n        this.isProactiveRefreshEnabled = false;\\r\\n        // Any network calls will set this to true and prevent subsequent emulator\\r\\n        // initialization\\r\\n        this._canInitEmulator = true;\\r\\n        this._isInitialized = false;\\r\\n        this._deleted = false;\\r\\n        this._initializationPromise = null;\\r\\n        this._popupRedirectResolver = null;\\r\\n        this._errorFactory = _DEFAULT_AUTH_ERROR_FACTORY;\\r\\n        // Tracks the last notified UID for state change listeners to prevent\\r\\n        // repeated calls to the callbacks. Undefined means it's never been\\r\\n        // called, whereas null means it's been called with a signed out user\\r\\n        this.lastNotifiedUid = undefined;\\r\\n        this.languageCode = null;\\r\\n        this.tenantId = null;\\r\\n        this.settings = { appVerificationDisabledForTesting: false };\\r\\n        this.frameworks = [];\\r\\n        this.name = app.name;\\r\\n        this.clientVersion = config.sdkClientVersion;\\r\\n    }\\r\\n    _initializeWithPersistence(persistenceHierarchy, popupRedirectResolver) {\\r\\n        if (popupRedirectResolver) {\\r\\n            this._popupRedirectResolver = _getInstance(popupRedirectResolver);\\r\\n        }\\r\\n        // Have to check for app deletion throughout initialization (after each\\r\\n        // promise resolution)\\r\\n        this._initializationPromise = this.queue(async () => {\\r\\n            var _a, _b;\\r\\n            if (this._deleted) {\\r\\n                return;\\r\\n            }\\r\\n            this.persistenceManager = await PersistenceUserManager.create(this, persistenceHierarchy);\\r\\n            if (this._deleted) {\\r\\n                return;\\r\\n            }\\r\\n            // Initialize the resolver early if necessary (only applicable to web:\\r\\n            // this will cause the iframe to load immediately in certain cases)\\r\\n            if ((_a = this._popupRedirectResolver) === null || _a === void 0 ? void 0 : _a._shouldInitProactively) {\\r\\n                // If this fails, don't halt auth loading\\r\\n                try {\\r\\n                    await this._popupRedirectResolver._initialize(this);\\r\\n                }\\r\\n                catch (e) { /* Ignore the error */ }\\r\\n            }\\r\\n            await this.initializeCurrentUser(popupRedirectResolver);\\r\\n            this.lastNotifiedUid = ((_b = this.currentUser) === null || _b === void 0 ? void 0 : _b.uid) || null;\\r\\n            if (this._deleted) {\\r\\n                return;\\r\\n            }\\r\\n            this._isInitialized = true;\\r\\n        });\\r\\n        return this._initializationPromise;\\r\\n    }\\r\\n    /**\\r\\n     * If the persistence is changed in another window, the user manager will let us know\\r\\n     */\\r\\n    async _onStorageEvent() {\\r\\n        if (this._deleted) {\\r\\n            return;\\r\\n        }\\r\\n        const user = await this.assertedPersistence.getCurrentUser();\\r\\n        if (!this.currentUser && !user) {\\r\\n            // No change, do nothing (was signed out and remained signed out).\\r\\n            return;\\r\\n        }\\r\\n        // If the same user is to be synchronized.\\r\\n        if (this.currentUser && user && this.currentUser.uid === user.uid) {\\r\\n            // Data update, simply copy data changes.\\r\\n            this._currentUser._assign(user);\\r\\n            // If tokens changed from previous user tokens, this will trigger\\r\\n            // notifyAuthListeners_.\\r\\n            await this.currentUser.getIdToken();\\r\\n            return;\\r\\n        }\\r\\n        // Update current Auth state. Either a new login or logout.\\r\\n        // Skip blocking callbacks, they should not apply to a change in another tab.\\r\\n        await this._updateCurrentUser(user, /* skipBeforeStateCallbacks */ true);\\r\\n    }\\r\\n    async initializeCurrentUser(popupRedirectResolver) {\\r\\n        var _a;\\r\\n        // First check to see if we have a pending redirect event.\\r\\n        const previouslyStoredUser = (await this.assertedPersistence.getCurrentUser());\\r\\n        let futureCurrentUser = previouslyStoredUser;\\r\\n        let needsTocheckMiddleware = false;\\r\\n        if (popupRedirectResolver && this.config.authDomain) {\\r\\n            await this.getOrInitRedirectPersistenceManager();\\r\\n            const redirectUserEventId = (_a = this.redirectUser) === null || _a === void 0 ? void 0 : _a._redirectEventId;\\r\\n            const storedUserEventId = futureCurrentUser === null || futureCurrentUser === void 0 ? void 0 : futureCurrentUser._redirectEventId;\\r\\n            const result = await this.tryRedirectSignIn(popupRedirectResolver);\\r\\n            // If the stored user (i.e. the old \\\"currentUser\\\") has a redirectId that\\r\\n            // matches the redirect user, then we want to initially sign in with the\\r\\n            // new user object from result.\\r\\n            // TODO(samgho): More thoroughly test all of this\\r\\n            if ((!redirectUserEventId || redirectUserEventId === storedUserEventId) &&\\r\\n                (result === null || result === void 0 ? void 0 : result.user)) {\\r\\n                futureCurrentUser = result.user;\\r\\n                needsTocheckMiddleware = true;\\r\\n            }\\r\\n        }\\r\\n        // If no user in persistence, there is no current user. Set to null.\\r\\n        if (!futureCurrentUser) {\\r\\n            return this.directlySetCurrentUser(null);\\r\\n        }\\r\\n        if (!futureCurrentUser._redirectEventId) {\\r\\n            // This isn't a redirect link operation, we can reload and bail.\\r\\n            // First though, ensure that we check the middleware is happy.\\r\\n            if (needsTocheckMiddleware) {\\r\\n                try {\\r\\n                    await this.beforeStateQueue.runMiddleware(futureCurrentUser);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    futureCurrentUser = previouslyStoredUser;\\r\\n                    // We know this is available since the bit is only set when the\\r\\n                    // resolver is available\\r\\n                    this._popupRedirectResolver._overrideRedirectResult(this, () => Promise.reject(e));\\r\\n                }\\r\\n            }\\r\\n            if (futureCurrentUser) {\\r\\n                return this.reloadAndSetCurrentUserOrClear(futureCurrentUser);\\r\\n            }\\r\\n            else {\\r\\n                return this.directlySetCurrentUser(null);\\r\\n            }\\r\\n        }\\r\\n        _assert(this._popupRedirectResolver, this, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        await this.getOrInitRedirectPersistenceManager();\\r\\n        // If the redirect user's event ID matches the current user's event ID,\\r\\n        // DO NOT reload the current user, otherwise they'll be cleared from storage.\\r\\n        // This is important for the reauthenticateWithRedirect() flow.\\r\\n        if (this.redirectUser &&\\r\\n            this.redirectUser._redirectEventId === futureCurrentUser._redirectEventId) {\\r\\n            return this.directlySetCurrentUser(futureCurrentUser);\\r\\n        }\\r\\n        return this.reloadAndSetCurrentUserOrClear(futureCurrentUser);\\r\\n    }\\r\\n    async tryRedirectSignIn(redirectResolver) {\\r\\n        // The redirect user needs to be checked (and signed in if available)\\r\\n        // during auth initialization. All of the normal sign in and link/reauth\\r\\n        // flows call back into auth and push things onto the promise queue. We\\r\\n        // need to await the result of the redirect sign in *inside the promise\\r\\n        // queue*. This presents a problem: we run into deadlock. See:\\r\\n        //    ┌> [Initialization] ─────┐\\r\\n        //    ┌> [<other queue tasks>] │\\r\\n        //    └─ [getRedirectResult] <─┘\\r\\n        //    where [] are tasks on the queue and arrows denote awaits\\r\\n        // Initialization will never complete because it's waiting on something\\r\\n        // that's waiting for initialization to complete!\\r\\n        //\\r\\n        // Instead, this method calls getRedirectResult() (stored in\\r\\n        // _completeRedirectFn) with an optional parameter that instructs all of\\r\\n        // the underlying auth operations to skip anything that mutates auth state.\\r\\n        let result = null;\\r\\n        try {\\r\\n            // We know this._popupRedirectResolver is set since redirectResolver\\r\\n            // is passed in. The _completeRedirectFn expects the unwrapped extern.\\r\\n            result = await this._popupRedirectResolver._completeRedirectFn(this, redirectResolver, true);\\r\\n        }\\r\\n        catch (e) {\\r\\n            // Swallow any errors here; the code can retrieve them in\\r\\n            // getRedirectResult().\\r\\n            await this._setRedirectUser(null);\\r\\n        }\\r\\n        return result;\\r\\n    }\\r\\n    async reloadAndSetCurrentUserOrClear(user) {\\r\\n        try {\\r\\n            await _reloadWithoutSaving(user);\\r\\n        }\\r\\n        catch (e) {\\r\\n            if (e.code !== `auth/${\\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */}`) {\\r\\n                // Something's wrong with the user's token. Log them out and remove\\r\\n                // them from storage\\r\\n                return this.directlySetCurrentUser(null);\\r\\n            }\\r\\n        }\\r\\n        return this.directlySetCurrentUser(user);\\r\\n    }\\r\\n    useDeviceLanguage() {\\r\\n        this.languageCode = _getUserLanguage();\\r\\n    }\\r\\n    async _delete() {\\r\\n        this._deleted = true;\\r\\n    }\\r\\n    async updateCurrentUser(userExtern) {\\r\\n        // The public updateCurrentUser method needs to make a copy of the user,\\r\\n        // and also check that the project matches\\r\\n        const user = userExtern\\r\\n            ? (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(userExtern)\\r\\n            : null;\\r\\n        if (user) {\\r\\n            _assert(user.auth.config.apiKey === this.config.apiKey, this, \\\"invalid-user-token\\\" /* INVALID_AUTH */);\\r\\n        }\\r\\n        return this._updateCurrentUser(user && user._clone(this));\\r\\n    }\\r\\n    async _updateCurrentUser(user, skipBeforeStateCallbacks = false) {\\r\\n        if (this._deleted) {\\r\\n            return;\\r\\n        }\\r\\n        if (user) {\\r\\n            _assert(this.tenantId === user.tenantId, this, \\\"tenant-id-mismatch\\\" /* TENANT_ID_MISMATCH */);\\r\\n        }\\r\\n        if (!skipBeforeStateCallbacks) {\\r\\n            await this.beforeStateQueue.runMiddleware(user);\\r\\n        }\\r\\n        return this.queue(async () => {\\r\\n            await this.directlySetCurrentUser(user);\\r\\n            this.notifyAuthListeners();\\r\\n        });\\r\\n    }\\r\\n    async signOut() {\\r\\n        // Run first, to block _setRedirectUser() if any callbacks fail.\\r\\n        await this.beforeStateQueue.runMiddleware(null);\\r\\n        // Clear the redirect user when signOut is called\\r\\n        if (this.redirectPersistenceManager || this._popupRedirectResolver) {\\r\\n            await this._setRedirectUser(null);\\r\\n        }\\r\\n        // Prevent callbacks from being called again in _updateCurrentUser, as\\r\\n        // they were already called in the first line.\\r\\n        return this._updateCurrentUser(null, /* skipBeforeStateCallbacks */ true);\\r\\n    }\\r\\n    setPersistence(persistence) {\\r\\n        return this.queue(async () => {\\r\\n            await this.assertedPersistence.setPersistence(_getInstance(persistence));\\r\\n        });\\r\\n    }\\r\\n    _getPersistence() {\\r\\n        return this.assertedPersistence.persistence.type;\\r\\n    }\\r\\n    _updateErrorMap(errorMap) {\\r\\n        this._errorFactory = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.ErrorFactory('auth', 'Firebase', errorMap());\\r\\n    }\\r\\n    onAuthStateChanged(nextOrObserver, error, completed) {\\r\\n        return this.registerStateListener(this.authStateSubscription, nextOrObserver, error, completed);\\r\\n    }\\r\\n    beforeAuthStateChanged(callback, onAbort) {\\r\\n        return this.beforeStateQueue.pushCallback(callback, onAbort);\\r\\n    }\\r\\n    onIdTokenChanged(nextOrObserver, error, completed) {\\r\\n        return this.registerStateListener(this.idTokenSubscription, nextOrObserver, error, completed);\\r\\n    }\\r\\n    toJSON() {\\r\\n        var _a;\\r\\n        return {\\r\\n            apiKey: this.config.apiKey,\\r\\n            authDomain: this.config.authDomain,\\r\\n            appName: this.name,\\r\\n            currentUser: (_a = this._currentUser) === null || _a === void 0 ? void 0 : _a.toJSON()\\r\\n        };\\r\\n    }\\r\\n    async _setRedirectUser(user, popupRedirectResolver) {\\r\\n        const redirectManager = await this.getOrInitRedirectPersistenceManager(popupRedirectResolver);\\r\\n        return user === null\\r\\n            ? redirectManager.removeCurrentUser()\\r\\n            : redirectManager.setCurrentUser(user);\\r\\n    }\\r\\n    async getOrInitRedirectPersistenceManager(popupRedirectResolver) {\\r\\n        if (!this.redirectPersistenceManager) {\\r\\n            const resolver = (popupRedirectResolver && _getInstance(popupRedirectResolver)) ||\\r\\n                this._popupRedirectResolver;\\r\\n            _assert(resolver, this, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n            this.redirectPersistenceManager = await PersistenceUserManager.create(this, [_getInstance(resolver._redirectPersistence)], \\\"redirectUser\\\" /* REDIRECT_USER */);\\r\\n            this.redirectUser =\\r\\n                await this.redirectPersistenceManager.getCurrentUser();\\r\\n        }\\r\\n        return this.redirectPersistenceManager;\\r\\n    }\\r\\n    async _redirectUserForId(id) {\\r\\n        var _a, _b;\\r\\n        // Make sure we've cleared any pending persistence actions if we're not in\\r\\n        // the initializer\\r\\n        if (this._isInitialized) {\\r\\n            await this.queue(async () => { });\\r\\n        }\\r\\n        if (((_a = this._currentUser) === null || _a === void 0 ? void 0 : _a._redirectEventId) === id) {\\r\\n            return this._currentUser;\\r\\n        }\\r\\n        if (((_b = this.redirectUser) === null || _b === void 0 ? void 0 : _b._redirectEventId) === id) {\\r\\n            return this.redirectUser;\\r\\n        }\\r\\n        return null;\\r\\n    }\\r\\n    async _persistUserIfCurrent(user) {\\r\\n        if (user === this.currentUser) {\\r\\n            return this.queue(async () => this.directlySetCurrentUser(user));\\r\\n        }\\r\\n    }\\r\\n    /** Notifies listeners only if the user is current */\\r\\n    _notifyListenersIfCurrent(user) {\\r\\n        if (user === this.currentUser) {\\r\\n            this.notifyAuthListeners();\\r\\n        }\\r\\n    }\\r\\n    _key() {\\r\\n        return `${this.config.authDomain}:${this.config.apiKey}:${this.name}`;\\r\\n    }\\r\\n    _startProactiveRefresh() {\\r\\n        this.isProactiveRefreshEnabled = true;\\r\\n        if (this.currentUser) {\\r\\n            this._currentUser._startProactiveRefresh();\\r\\n        }\\r\\n    }\\r\\n    _stopProactiveRefresh() {\\r\\n        this.isProactiveRefreshEnabled = false;\\r\\n        if (this.currentUser) {\\r\\n            this._currentUser._stopProactiveRefresh();\\r\\n        }\\r\\n    }\\r\\n    /** Returns the current user cast as the internal type */\\r\\n    get _currentUser() {\\r\\n        return this.currentUser;\\r\\n    }\\r\\n    notifyAuthListeners() {\\r\\n        var _a, _b;\\r\\n        if (!this._isInitialized) {\\r\\n            return;\\r\\n        }\\r\\n        this.idTokenSubscription.next(this.currentUser);\\r\\n        const currentUid = (_b = (_a = this.currentUser) === null || _a === void 0 ? void 0 : _a.uid) !== null && _b !== void 0 ? _b : null;\\r\\n        if (this.lastNotifiedUid !== currentUid) {\\r\\n            this.lastNotifiedUid = currentUid;\\r\\n            this.authStateSubscription.next(this.currentUser);\\r\\n        }\\r\\n    }\\r\\n    registerStateListener(subscription, nextOrObserver, error, completed) {\\r\\n        if (this._deleted) {\\r\\n            return () => { };\\r\\n        }\\r\\n        const cb = typeof nextOrObserver === 'function'\\r\\n            ? nextOrObserver\\r\\n            : nextOrObserver.next.bind(nextOrObserver);\\r\\n        const promise = this._isInitialized\\r\\n            ? Promise.resolve()\\r\\n            : this._initializationPromise;\\r\\n        _assert(promise, this, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        // The callback needs to be called asynchronously per the spec.\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        promise.then(() => cb(this.currentUser));\\r\\n        if (typeof nextOrObserver === 'function') {\\r\\n            return subscription.addObserver(nextOrObserver, error, completed);\\r\\n        }\\r\\n        else {\\r\\n            return subscription.addObserver(nextOrObserver);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Unprotected (from race conditions) method to set the current user. This\\r\\n     * should only be called from within a queued callback. This is necessary\\r\\n     * because the queue shouldn't rely on another queued callback.\\r\\n     */\\r\\n    async directlySetCurrentUser(user) {\\r\\n        if (this.currentUser && this.currentUser !== user) {\\r\\n            this._currentUser._stopProactiveRefresh();\\r\\n            if (user && this.isProactiveRefreshEnabled) {\\r\\n                user._startProactiveRefresh();\\r\\n            }\\r\\n        }\\r\\n        this.currentUser = user;\\r\\n        if (user) {\\r\\n            await this.assertedPersistence.setCurrentUser(user);\\r\\n        }\\r\\n        else {\\r\\n            await this.assertedPersistence.removeCurrentUser();\\r\\n        }\\r\\n    }\\r\\n    queue(action) {\\r\\n        // In case something errors, the callback still should be called in order\\r\\n        // to keep the promise chain alive\\r\\n        this.operations = this.operations.then(action, action);\\r\\n        return this.operations;\\r\\n    }\\r\\n    get assertedPersistence() {\\r\\n        _assert(this.persistenceManager, this, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        return this.persistenceManager;\\r\\n    }\\r\\n    _logFramework(framework) {\\r\\n        if (!framework || this.frameworks.includes(framework)) {\\r\\n            return;\\r\\n        }\\r\\n        this.frameworks.push(framework);\\r\\n        // Sort alphabetically so that \\\"FirebaseCore-web,FirebaseUI-web\\\" and\\r\\n        // \\\"FirebaseUI-web,FirebaseCore-web\\\" aren't viewed as different.\\r\\n        this.frameworks.sort();\\r\\n        this.clientVersion = _getClientVersion(this.config.clientPlatform, this._getFrameworks());\\r\\n    }\\r\\n    _getFrameworks() {\\r\\n        return this.frameworks;\\r\\n    }\\r\\n    async _getAdditionalHeaders() {\\r\\n        var _a;\\r\\n        // Additional headers on every request\\r\\n        const headers = {\\r\\n            [\\\"X-Client-Version\\\" /* X_CLIENT_VERSION */]: this.clientVersion,\\r\\n        };\\r\\n        if (this.app.options.appId) {\\r\\n            headers[\\\"X-Firebase-gmpid\\\" /* X_FIREBASE_GMPID */] = this.app.options.appId;\\r\\n        }\\r\\n        // If the heartbeat service exists, add the heartbeat string\\r\\n        const heartbeatsHeader = await ((_a = this.heartbeatServiceProvider.getImmediate({\\r\\n            optional: true,\\r\\n        })) === null || _a === void 0 ? void 0 : _a.getHeartbeatsHeader());\\r\\n        if (heartbeatsHeader) {\\r\\n            headers[\\\"X-Firebase-Client\\\" /* X_FIREBASE_CLIENT */] = heartbeatsHeader;\\r\\n        }\\r\\n        return headers;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Method to be used to cast down to our private implmentation of Auth.\\r\\n * It will also handle unwrapping from the compat type if necessary\\r\\n *\\r\\n * @param auth Auth object passed in from developer\\r\\n */\\r\\nfunction _castAuth(auth) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\\r\\n}\\r\\n/** Helper class to wrap subscriber logic */\\r\\nclass Subscription {\\r\\n    constructor(auth) {\\r\\n        this.auth = auth;\\r\\n        this.observer = null;\\r\\n        this.addObserver = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.createSubscribe)(observer => (this.observer = observer));\\r\\n    }\\r\\n    get next() {\\r\\n        _assert(this.observer, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        return this.observer.next.bind(this.observer);\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production\\r\\n * Firebase Auth services.\\r\\n *\\r\\n * @remarks\\r\\n * This must be called synchronously immediately following the first call to\\r\\n * {@link initializeAuth}.  Do not use with production credentials as emulator\\r\\n * traffic is not encrypted.\\r\\n *\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * connectAuthEmulator(auth, 'http://127.0.0.1:9099', { disableWarnings: true });\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param url - The URL at which the emulator is running (eg, 'http://localhost:9099').\\r\\n * @param options - Optional. `options.disableWarnings` defaults to `false`. Set it to\\r\\n * `true` to disable the warning banner attached to the DOM.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction connectAuthEmulator(auth, url, options) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    _assert(authInternal._canInitEmulator, authInternal, \\\"emulator-config-failed\\\" /* EMULATOR_CONFIG_FAILED */);\\r\\n    _assert(/^https?:\\\\/\\\\//.test(url), authInternal, \\\"invalid-emulator-scheme\\\" /* INVALID_EMULATOR_SCHEME */);\\r\\n    const disableWarnings = !!(options === null || options === void 0 ? void 0 : options.disableWarnings);\\r\\n    const protocol = extractProtocol(url);\\r\\n    const { host, port } = extractHostAndPort(url);\\r\\n    const portStr = port === null ? '' : `:${port}`;\\r\\n    // Always replace path with \\\"/\\\" (even if input url had no path at all, or had a different one).\\r\\n    authInternal.config.emulator = { url: `${protocol}//${host}${portStr}/` };\\r\\n    authInternal.settings.appVerificationDisabledForTesting = true;\\r\\n    authInternal.emulatorConfig = Object.freeze({\\r\\n        host,\\r\\n        port,\\r\\n        protocol: protocol.replace(':', ''),\\r\\n        options: Object.freeze({ disableWarnings })\\r\\n    });\\r\\n    if (!disableWarnings) {\\r\\n        emitEmulatorWarning();\\r\\n    }\\r\\n}\\r\\nfunction extractProtocol(url) {\\r\\n    const protocolEnd = url.indexOf(':');\\r\\n    return protocolEnd < 0 ? '' : url.substr(0, protocolEnd + 1);\\r\\n}\\r\\nfunction extractHostAndPort(url) {\\r\\n    const protocol = extractProtocol(url);\\r\\n    const authority = /(\\\\/\\\\/)?([^?#/]+)/.exec(url.substr(protocol.length)); // Between // and /, ? or #.\\r\\n    if (!authority) {\\r\\n        return { host: '', port: null };\\r\\n    }\\r\\n    const hostAndPort = authority[2].split('@').pop() || ''; // Strip out \\\"username:password@\\\".\\r\\n    const bracketedIPv6 = /^(\\\\[[^\\\\]]+\\\\])(:|$)/.exec(hostAndPort);\\r\\n    if (bracketedIPv6) {\\r\\n        const host = bracketedIPv6[1];\\r\\n        return { host, port: parsePort(hostAndPort.substr(host.length + 1)) };\\r\\n    }\\r\\n    else {\\r\\n        const [host, port] = hostAndPort.split(':');\\r\\n        return { host, port: parsePort(port) };\\r\\n    }\\r\\n}\\r\\nfunction parsePort(portStr) {\\r\\n    if (!portStr) {\\r\\n        return null;\\r\\n    }\\r\\n    const port = Number(portStr);\\r\\n    if (isNaN(port)) {\\r\\n        return null;\\r\\n    }\\r\\n    return port;\\r\\n}\\r\\nfunction emitEmulatorWarning() {\\r\\n    function attachBanner() {\\r\\n        const el = document.createElement('p');\\r\\n        const sty = el.style;\\r\\n        el.innerText =\\r\\n            'Running in emulator mode. Do not use with production credentials.';\\r\\n        sty.position = 'fixed';\\r\\n        sty.width = '100%';\\r\\n        sty.backgroundColor = '#ffffff';\\r\\n        sty.border = '.1em solid #000000';\\r\\n        sty.color = '#b50000';\\r\\n        sty.bottom = '0px';\\r\\n        sty.left = '0px';\\r\\n        sty.margin = '0px';\\r\\n        sty.zIndex = '10000';\\r\\n        sty.textAlign = 'center';\\r\\n        el.classList.add('firebase-emulator-warning');\\r\\n        document.body.appendChild(el);\\r\\n    }\\r\\n    if (typeof console !== 'undefined' && typeof console.info === 'function') {\\r\\n        console.info('WARNING: You are using the Auth Emulator,' +\\r\\n            ' which is intended for local testing only.  Do not use with' +\\r\\n            ' production credentials.');\\r\\n    }\\r\\n    if (typeof window !== 'undefined' &&\\r\\n        typeof document !== 'undefined') {\\r\\n        if (document.readyState === 'loading') {\\r\\n            window.addEventListener('DOMContentLoaded', attachBanner);\\r\\n        }\\r\\n        else {\\r\\n            attachBanner();\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Interface that represents the credentials returned by an {@link AuthProvider}.\\r\\n *\\r\\n * @remarks\\r\\n * Implementations specify the details about each auth provider's credential requirements.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass AuthCredential {\\r\\n    /** @internal */\\r\\n    constructor(\\r\\n    /**\\r\\n     * The authentication provider ID for the credential.\\r\\n     *\\r\\n     * @remarks\\r\\n     * For example, 'facebook.com', or 'google.com'.\\r\\n     */\\r\\n    providerId, \\r\\n    /**\\r\\n     * The authentication sign in method for the credential.\\r\\n     *\\r\\n     * @remarks\\r\\n     * For example, {@link SignInMethod}.EMAIL_PASSWORD, or\\r\\n     * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method\\r\\n     * identifier as returned in {@link fetchSignInMethodsForEmail}.\\r\\n     */\\r\\n    signInMethod) {\\r\\n        this.providerId = providerId;\\r\\n        this.signInMethod = signInMethod;\\r\\n    }\\r\\n    /**\\r\\n     * Returns a JSON-serializable representation of this object.\\r\\n     *\\r\\n     * @returns a JSON-serializable representation of this object.\\r\\n     */\\r\\n    toJSON() {\\r\\n        return debugFail('not implemented');\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getIdTokenResponse(_auth) {\\r\\n        return debugFail('not implemented');\\r\\n    }\\r\\n    /** @internal */\\r\\n    _linkToIdToken(_auth, _idToken) {\\r\\n        return debugFail('not implemented');\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getReauthenticationResolver(_auth) {\\r\\n        return debugFail('not implemented');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function resetPassword(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:resetPassword\\\" /* RESET_PASSWORD */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nasync function updateEmailPassword(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:update\\\" /* SET_ACCOUNT_INFO */, request);\\r\\n}\\r\\nasync function applyActionCode$1(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:update\\\" /* SET_ACCOUNT_INFO */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function signInWithPassword(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithPassword\\\" /* SIGN_IN_WITH_PASSWORD */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nasync function sendOobCode(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:sendOobCode\\\" /* SEND_OOB_CODE */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nasync function sendEmailVerification$1(auth, request) {\\r\\n    return sendOobCode(auth, request);\\r\\n}\\r\\nasync function sendPasswordResetEmail$1(auth, request) {\\r\\n    return sendOobCode(auth, request);\\r\\n}\\r\\nasync function sendSignInLinkToEmail$1(auth, request) {\\r\\n    return sendOobCode(auth, request);\\r\\n}\\r\\nasync function verifyAndChangeEmail(auth, request) {\\r\\n    return sendOobCode(auth, request);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function signInWithEmailLink$1(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithEmailLink\\\" /* SIGN_IN_WITH_EMAIL_LINK */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nasync function signInWithEmailLinkForLinking(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithEmailLink\\\" /* SIGN_IN_WITH_EMAIL_LINK */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Interface that represents the credentials returned by {@link EmailAuthProvider} for\\r\\n * {@link ProviderId}.PASSWORD\\r\\n *\\r\\n * @remarks\\r\\n * Covers both {@link SignInMethod}.EMAIL_PASSWORD and\\r\\n * {@link SignInMethod}.EMAIL_LINK.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass EmailAuthCredential extends AuthCredential {\\r\\n    /** @internal */\\r\\n    constructor(\\r\\n    /** @internal */\\r\\n    _email, \\r\\n    /** @internal */\\r\\n    _password, signInMethod, \\r\\n    /** @internal */\\r\\n    _tenantId = null) {\\r\\n        super(\\\"password\\\" /* PASSWORD */, signInMethod);\\r\\n        this._email = _email;\\r\\n        this._password = _password;\\r\\n        this._tenantId = _tenantId;\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromEmailAndPassword(email, password) {\\r\\n        return new EmailAuthCredential(email, password, \\\"password\\\" /* EMAIL_PASSWORD */);\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromEmailAndCode(email, oobCode, tenantId = null) {\\r\\n        return new EmailAuthCredential(email, oobCode, \\\"emailLink\\\" /* EMAIL_LINK */, tenantId);\\r\\n    }\\r\\n    /** {@inheritdoc AuthCredential.toJSON} */\\r\\n    toJSON() {\\r\\n        return {\\r\\n            email: this._email,\\r\\n            password: this._password,\\r\\n            signInMethod: this.signInMethod,\\r\\n            tenantId: this._tenantId\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Static method to deserialize a JSON representation of an object into an {@link  AuthCredential}.\\r\\n     *\\r\\n     * @param json - Either `object` or the stringified representation of the object. When string is\\r\\n     * provided, `JSON.parse` would be called first.\\r\\n     *\\r\\n     * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.\\r\\n     */\\r\\n    static fromJSON(json) {\\r\\n        const obj = typeof json === 'string' ? JSON.parse(json) : json;\\r\\n        if ((obj === null || obj === void 0 ? void 0 : obj.email) && (obj === null || obj === void 0 ? void 0 : obj.password)) {\\r\\n            if (obj.signInMethod === \\\"password\\\" /* EMAIL_PASSWORD */) {\\r\\n                return this._fromEmailAndPassword(obj.email, obj.password);\\r\\n            }\\r\\n            else if (obj.signInMethod === \\\"emailLink\\\" /* EMAIL_LINK */) {\\r\\n                return this._fromEmailAndCode(obj.email, obj.password, obj.tenantId);\\r\\n            }\\r\\n        }\\r\\n        return null;\\r\\n    }\\r\\n    /** @internal */\\r\\n    async _getIdTokenResponse(auth) {\\r\\n        switch (this.signInMethod) {\\r\\n            case \\\"password\\\" /* EMAIL_PASSWORD */:\\r\\n                return signInWithPassword(auth, {\\r\\n                    returnSecureToken: true,\\r\\n                    email: this._email,\\r\\n                    password: this._password\\r\\n                });\\r\\n            case \\\"emailLink\\\" /* EMAIL_LINK */:\\r\\n                return signInWithEmailLink$1(auth, {\\r\\n                    email: this._email,\\r\\n                    oobCode: this._password\\r\\n                });\\r\\n            default:\\r\\n                _fail(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        }\\r\\n    }\\r\\n    /** @internal */\\r\\n    async _linkToIdToken(auth, idToken) {\\r\\n        switch (this.signInMethod) {\\r\\n            case \\\"password\\\" /* EMAIL_PASSWORD */:\\r\\n                return updateEmailPassword(auth, {\\r\\n                    idToken,\\r\\n                    returnSecureToken: true,\\r\\n                    email: this._email,\\r\\n                    password: this._password\\r\\n                });\\r\\n            case \\\"emailLink\\\" /* EMAIL_LINK */:\\r\\n                return signInWithEmailLinkForLinking(auth, {\\r\\n                    idToken,\\r\\n                    email: this._email,\\r\\n                    oobCode: this._password\\r\\n                });\\r\\n            default:\\r\\n                _fail(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        }\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getReauthenticationResolver(auth) {\\r\\n        return this._getIdTokenResponse(auth);\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function signInWithIdp(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithIdp\\\" /* SIGN_IN_WITH_IDP */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst IDP_REQUEST_URI$1 = 'http://localhost';\\r\\n/**\\r\\n * Represents the OAuth credentials returned by an {@link OAuthProvider}.\\r\\n *\\r\\n * @remarks\\r\\n * Implementations specify the details about each auth provider's credential requirements.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass OAuthCredential extends AuthCredential {\\r\\n    constructor() {\\r\\n        super(...arguments);\\r\\n        this.pendingToken = null;\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromParams(params) {\\r\\n        const cred = new OAuthCredential(params.providerId, params.signInMethod);\\r\\n        if (params.idToken || params.accessToken) {\\r\\n            // OAuth 2 and either ID token or access token.\\r\\n            if (params.idToken) {\\r\\n                cred.idToken = params.idToken;\\r\\n            }\\r\\n            if (params.accessToken) {\\r\\n                cred.accessToken = params.accessToken;\\r\\n            }\\r\\n            // Add nonce if available and no pendingToken is present.\\r\\n            if (params.nonce && !params.pendingToken) {\\r\\n                cred.nonce = params.nonce;\\r\\n            }\\r\\n            if (params.pendingToken) {\\r\\n                cred.pendingToken = params.pendingToken;\\r\\n            }\\r\\n        }\\r\\n        else if (params.oauthToken && params.oauthTokenSecret) {\\r\\n            // OAuth 1 and OAuth token with token secret\\r\\n            cred.accessToken = params.oauthToken;\\r\\n            cred.secret = params.oauthTokenSecret;\\r\\n        }\\r\\n        else {\\r\\n            _fail(\\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        }\\r\\n        return cred;\\r\\n    }\\r\\n    /** {@inheritdoc AuthCredential.toJSON}  */\\r\\n    toJSON() {\\r\\n        return {\\r\\n            idToken: this.idToken,\\r\\n            accessToken: this.accessToken,\\r\\n            secret: this.secret,\\r\\n            nonce: this.nonce,\\r\\n            pendingToken: this.pendingToken,\\r\\n            providerId: this.providerId,\\r\\n            signInMethod: this.signInMethod\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Static method to deserialize a JSON representation of an object into an\\r\\n     * {@link  AuthCredential}.\\r\\n     *\\r\\n     * @param json - Input can be either Object or the stringified representation of the object.\\r\\n     * When string is provided, JSON.parse would be called first.\\r\\n     *\\r\\n     * @returns If the JSON input does not represent an {@link  AuthCredential}, null is returned.\\r\\n     */\\r\\n    static fromJSON(json) {\\r\\n        const obj = typeof json === 'string' ? JSON.parse(json) : json;\\r\\n        const { providerId, signInMethod } = obj, rest = (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__rest)(obj, [\\\"providerId\\\", \\\"signInMethod\\\"]);\\r\\n        if (!providerId || !signInMethod) {\\r\\n            return null;\\r\\n        }\\r\\n        const cred = new OAuthCredential(providerId, signInMethod);\\r\\n        cred.idToken = rest.idToken || undefined;\\r\\n        cred.accessToken = rest.accessToken || undefined;\\r\\n        cred.secret = rest.secret;\\r\\n        cred.nonce = rest.nonce;\\r\\n        cred.pendingToken = rest.pendingToken || null;\\r\\n        return cred;\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getIdTokenResponse(auth) {\\r\\n        const request = this.buildRequest();\\r\\n        return signInWithIdp(auth, request);\\r\\n    }\\r\\n    /** @internal */\\r\\n    _linkToIdToken(auth, idToken) {\\r\\n        const request = this.buildRequest();\\r\\n        request.idToken = idToken;\\r\\n        return signInWithIdp(auth, request);\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getReauthenticationResolver(auth) {\\r\\n        const request = this.buildRequest();\\r\\n        request.autoCreate = false;\\r\\n        return signInWithIdp(auth, request);\\r\\n    }\\r\\n    buildRequest() {\\r\\n        const request = {\\r\\n            requestUri: IDP_REQUEST_URI$1,\\r\\n            returnSecureToken: true\\r\\n        };\\r\\n        if (this.pendingToken) {\\r\\n            request.pendingToken = this.pendingToken;\\r\\n        }\\r\\n        else {\\r\\n            const postBody = {};\\r\\n            if (this.idToken) {\\r\\n                postBody['id_token'] = this.idToken;\\r\\n            }\\r\\n            if (this.accessToken) {\\r\\n                postBody['access_token'] = this.accessToken;\\r\\n            }\\r\\n            if (this.secret) {\\r\\n                postBody['oauth_token_secret'] = this.secret;\\r\\n            }\\r\\n            postBody['providerId'] = this.providerId;\\r\\n            if (this.nonce && !this.pendingToken) {\\r\\n                postBody['nonce'] = this.nonce;\\r\\n            }\\r\\n            request.postBody = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystring)(postBody);\\r\\n        }\\r\\n        return request;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function sendPhoneVerificationCode(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:sendVerificationCode\\\" /* SEND_VERIFICATION_CODE */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nasync function signInWithPhoneNumber$1(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithPhoneNumber\\\" /* SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nasync function linkWithPhoneNumber$1(auth, request) {\\r\\n    const response = await _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithPhoneNumber\\\" /* SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, request));\\r\\n    if (response.temporaryProof) {\\r\\n        throw _makeTaggedError(auth, \\\"account-exists-with-different-credential\\\" /* NEED_CONFIRMATION */, response);\\r\\n    }\\r\\n    return response;\\r\\n}\\r\\nconst VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_ = {\\r\\n    [\\\"USER_NOT_FOUND\\\" /* USER_NOT_FOUND */]: \\\"user-not-found\\\" /* USER_DELETED */\\r\\n};\\r\\nasync function verifyPhoneNumberForExisting(auth, request) {\\r\\n    const apiRequest = Object.assign(Object.assign({}, request), { operation: 'REAUTH' });\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithPhoneNumber\\\" /* SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, apiRequest), VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Represents the credentials returned by {@link PhoneAuthProvider}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass PhoneAuthCredential extends AuthCredential {\\r\\n    constructor(params) {\\r\\n        super(\\\"phone\\\" /* PHONE */, \\\"phone\\\" /* PHONE */);\\r\\n        this.params = params;\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromVerification(verificationId, verificationCode) {\\r\\n        return new PhoneAuthCredential({ verificationId, verificationCode });\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromTokenResponse(phoneNumber, temporaryProof) {\\r\\n        return new PhoneAuthCredential({ phoneNumber, temporaryProof });\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getIdTokenResponse(auth) {\\r\\n        return signInWithPhoneNumber$1(auth, this._makeVerificationRequest());\\r\\n    }\\r\\n    /** @internal */\\r\\n    _linkToIdToken(auth, idToken) {\\r\\n        return linkWithPhoneNumber$1(auth, Object.assign({ idToken }, this._makeVerificationRequest()));\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getReauthenticationResolver(auth) {\\r\\n        return verifyPhoneNumberForExisting(auth, this._makeVerificationRequest());\\r\\n    }\\r\\n    /** @internal */\\r\\n    _makeVerificationRequest() {\\r\\n        const { temporaryProof, phoneNumber, verificationId, verificationCode } = this.params;\\r\\n        if (temporaryProof && phoneNumber) {\\r\\n            return { temporaryProof, phoneNumber };\\r\\n        }\\r\\n        return {\\r\\n            sessionInfo: verificationId,\\r\\n            code: verificationCode\\r\\n        };\\r\\n    }\\r\\n    /** {@inheritdoc AuthCredential.toJSON} */\\r\\n    toJSON() {\\r\\n        const obj = {\\r\\n            providerId: this.providerId\\r\\n        };\\r\\n        if (this.params.phoneNumber) {\\r\\n            obj.phoneNumber = this.params.phoneNumber;\\r\\n        }\\r\\n        if (this.params.temporaryProof) {\\r\\n            obj.temporaryProof = this.params.temporaryProof;\\r\\n        }\\r\\n        if (this.params.verificationCode) {\\r\\n            obj.verificationCode = this.params.verificationCode;\\r\\n        }\\r\\n        if (this.params.verificationId) {\\r\\n            obj.verificationId = this.params.verificationId;\\r\\n        }\\r\\n        return obj;\\r\\n    }\\r\\n    /** Generates a phone credential based on a plain object or a JSON string. */\\r\\n    static fromJSON(json) {\\r\\n        if (typeof json === 'string') {\\r\\n            json = JSON.parse(json);\\r\\n        }\\r\\n        const { verificationId, verificationCode, phoneNumber, temporaryProof } = json;\\r\\n        if (!verificationCode &&\\r\\n            !verificationId &&\\r\\n            !phoneNumber &&\\r\\n            !temporaryProof) {\\r\\n            return null;\\r\\n        }\\r\\n        return new PhoneAuthCredential({\\r\\n            verificationId,\\r\\n            verificationCode,\\r\\n            phoneNumber,\\r\\n            temporaryProof\\r\\n        });\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Maps the mode string in action code URL to Action Code Info operation.\\r\\n *\\r\\n * @param mode\\r\\n */\\r\\nfunction parseMode(mode) {\\r\\n    switch (mode) {\\r\\n        case 'recoverEmail':\\r\\n            return \\\"RECOVER_EMAIL\\\" /* RECOVER_EMAIL */;\\r\\n        case 'resetPassword':\\r\\n            return \\\"PASSWORD_RESET\\\" /* PASSWORD_RESET */;\\r\\n        case 'signIn':\\r\\n            return \\\"EMAIL_SIGNIN\\\" /* EMAIL_SIGNIN */;\\r\\n        case 'verifyEmail':\\r\\n            return \\\"VERIFY_EMAIL\\\" /* VERIFY_EMAIL */;\\r\\n        case 'verifyAndChangeEmail':\\r\\n            return \\\"VERIFY_AND_CHANGE_EMAIL\\\" /* VERIFY_AND_CHANGE_EMAIL */;\\r\\n        case 'revertSecondFactorAddition':\\r\\n            return \\\"REVERT_SECOND_FACTOR_ADDITION\\\" /* REVERT_SECOND_FACTOR_ADDITION */;\\r\\n        default:\\r\\n            return null;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Helper to parse FDL links\\r\\n *\\r\\n * @param url\\r\\n */\\r\\nfunction parseDeepLink(url) {\\r\\n    const link = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystringDecode)((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.extractQuerystring)(url))['link'];\\r\\n    // Double link case (automatic redirect).\\r\\n    const doubleDeepLink = link\\r\\n        ? (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystringDecode)((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.extractQuerystring)(link))['deep_link_id']\\r\\n        : null;\\r\\n    // iOS custom scheme links.\\r\\n    const iOSDeepLink = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystringDecode)((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.extractQuerystring)(url))['deep_link_id'];\\r\\n    const iOSDoubleDeepLink = iOSDeepLink\\r\\n        ? (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystringDecode)((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.extractQuerystring)(iOSDeepLink))['link']\\r\\n        : null;\\r\\n    return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url;\\r\\n}\\r\\n/**\\r\\n * A utility class to parse email action URLs such as password reset, email verification,\\r\\n * email link sign in, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass ActionCodeURL {\\r\\n    /**\\r\\n     * @param actionLink - The link from which to extract the URL.\\r\\n     * @returns The {@link ActionCodeURL} object, or null if the link is invalid.\\r\\n     *\\r\\n     * @internal\\r\\n     */\\r\\n    constructor(actionLink) {\\r\\n        var _a, _b, _c, _d, _e, _f;\\r\\n        const searchParams = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystringDecode)((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.extractQuerystring)(actionLink));\\r\\n        const apiKey = (_a = searchParams[\\\"apiKey\\\" /* API_KEY */]) !== null && _a !== void 0 ? _a : null;\\r\\n        const code = (_b = searchParams[\\\"oobCode\\\" /* CODE */]) !== null && _b !== void 0 ? _b : null;\\r\\n        const operation = parseMode((_c = searchParams[\\\"mode\\\" /* MODE */]) !== null && _c !== void 0 ? _c : null);\\r\\n        // Validate API key, code and mode.\\r\\n        _assert(apiKey && code && operation, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        this.apiKey = apiKey;\\r\\n        this.operation = operation;\\r\\n        this.code = code;\\r\\n        this.continueUrl = (_d = searchParams[\\\"continueUrl\\\" /* CONTINUE_URL */]) !== null && _d !== void 0 ? _d : null;\\r\\n        this.languageCode = (_e = searchParams[\\\"languageCode\\\" /* LANGUAGE_CODE */]) !== null && _e !== void 0 ? _e : null;\\r\\n        this.tenantId = (_f = searchParams[\\\"tenantId\\\" /* TENANT_ID */]) !== null && _f !== void 0 ? _f : null;\\r\\n    }\\r\\n    /**\\r\\n     * Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,\\r\\n     * otherwise returns null.\\r\\n     *\\r\\n     * @param link  - The email action link string.\\r\\n     * @returns The {@link ActionCodeURL} object, or null if the link is invalid.\\r\\n     *\\r\\n     * @public\\r\\n     */\\r\\n    static parseLink(link) {\\r\\n        const actionLink = parseDeepLink(link);\\r\\n        try {\\r\\n            return new ActionCodeURL(actionLink);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Parses the email action link string and returns an {@link ActionCodeURL} if\\r\\n * the link is valid, otherwise returns null.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction parseActionCodeURL(link) {\\r\\n    return ActionCodeURL.parseLink(link);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for generating {@link EmailAuthCredential}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass EmailAuthProvider {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Always set to {@link ProviderId}.PASSWORD, even for email link.\\r\\n         */\\r\\n        this.providerId = EmailAuthProvider.PROVIDER_ID;\\r\\n    }\\r\\n    /**\\r\\n     * Initialize an {@link AuthCredential} using an email and password.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * const authCredential = EmailAuthProvider.credential(email, password);\\r\\n     * const userCredential = await signInWithCredential(auth, authCredential);\\r\\n     * ```\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * const userCredential = await signInWithEmailAndPassword(auth, email, password);\\r\\n     * ```\\r\\n     *\\r\\n     * @param email - Email address.\\r\\n     * @param password - User account password.\\r\\n     * @returns The auth provider credential.\\r\\n     */\\r\\n    static credential(email, password) {\\r\\n        return EmailAuthCredential._fromEmailAndPassword(email, password);\\r\\n    }\\r\\n    /**\\r\\n     * Initialize an {@link AuthCredential} using an email and an email link after a sign in with\\r\\n     * email link operation.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * const authCredential = EmailAuthProvider.credentialWithLink(auth, email, emailLink);\\r\\n     * const userCredential = await signInWithCredential(auth, authCredential);\\r\\n     * ```\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * await sendSignInLinkToEmail(auth, email);\\r\\n     * // Obtain emailLink from user.\\r\\n     * const userCredential = await signInWithEmailLink(auth, email, emailLink);\\r\\n     * ```\\r\\n     *\\r\\n     * @param auth - The {@link Auth} instance used to verify the link.\\r\\n     * @param email - Email address.\\r\\n     * @param emailLink - Sign-in email link.\\r\\n     * @returns - The auth provider credential.\\r\\n     */\\r\\n    static credentialWithLink(email, emailLink) {\\r\\n        const actionCodeUrl = ActionCodeURL.parseLink(emailLink);\\r\\n        _assert(actionCodeUrl, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        return EmailAuthCredential._fromEmailAndCode(email, actionCodeUrl.code, actionCodeUrl.tenantId);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Always set to {@link ProviderId}.PASSWORD, even for email link.\\r\\n */\\r\\nEmailAuthProvider.PROVIDER_ID = \\\"password\\\" /* PASSWORD */;\\r\\n/**\\r\\n * Always set to {@link SignInMethod}.EMAIL_PASSWORD.\\r\\n */\\r\\nEmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD = \\\"password\\\" /* EMAIL_PASSWORD */;\\r\\n/**\\r\\n * Always set to {@link SignInMethod}.EMAIL_LINK.\\r\\n */\\r\\nEmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD = \\\"emailLink\\\" /* EMAIL_LINK */;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The base class for all Federated providers (OAuth (including OIDC), SAML).\\r\\n *\\r\\n * This class is not meant to be instantiated directly.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass FederatedAuthProvider {\\r\\n    /**\\r\\n     * Constructor for generic OAuth providers.\\r\\n     *\\r\\n     * @param providerId - Provider for which credentials should be generated.\\r\\n     */\\r\\n    constructor(providerId) {\\r\\n        this.providerId = providerId;\\r\\n        /** @internal */\\r\\n        this.defaultLanguageCode = null;\\r\\n        /** @internal */\\r\\n        this.customParameters = {};\\r\\n    }\\r\\n    /**\\r\\n     * Set the language gode.\\r\\n     *\\r\\n     * @param languageCode - language code\\r\\n     */\\r\\n    setDefaultLanguage(languageCode) {\\r\\n        this.defaultLanguageCode = languageCode;\\r\\n    }\\r\\n    /**\\r\\n     * Sets the OAuth custom parameters to pass in an OAuth request for popup and redirect sign-in\\r\\n     * operations.\\r\\n     *\\r\\n     * @remarks\\r\\n     * For a detailed list, check the reserved required OAuth 2.0 parameters such as `client_id`,\\r\\n     * `redirect_uri`, `scope`, `response_type`, and `state` are not allowed and will be ignored.\\r\\n     *\\r\\n     * @param customOAuthParameters - The custom OAuth parameters to pass in the OAuth request.\\r\\n     */\\r\\n    setCustomParameters(customOAuthParameters) {\\r\\n        this.customParameters = customOAuthParameters;\\r\\n        return this;\\r\\n    }\\r\\n    /**\\r\\n     * Retrieve the current list of {@link CustomParameters}.\\r\\n     */\\r\\n    getCustomParameters() {\\r\\n        return this.customParameters;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Common code to all OAuth providers. This is separate from the\\r\\n * {@link OAuthProvider} so that child providers (like\\r\\n * {@link GoogleAuthProvider}) don't inherit the `credential` instance method.\\r\\n * Instead, they rely on a static `credential` method.\\r\\n */\\r\\nclass BaseOAuthProvider extends FederatedAuthProvider {\\r\\n    constructor() {\\r\\n        super(...arguments);\\r\\n        /** @internal */\\r\\n        this.scopes = [];\\r\\n    }\\r\\n    /**\\r\\n     * Add an OAuth scope to the credential.\\r\\n     *\\r\\n     * @param scope - Provider OAuth scope to add.\\r\\n     */\\r\\n    addScope(scope) {\\r\\n        // If not already added, add scope to list.\\r\\n        if (!this.scopes.includes(scope)) {\\r\\n            this.scopes.push(scope);\\r\\n        }\\r\\n        return this;\\r\\n    }\\r\\n    /**\\r\\n     * Retrieve the current list of OAuth scopes.\\r\\n     */\\r\\n    getScopes() {\\r\\n        return [...this.scopes];\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Provider for generating generic {@link OAuthCredential}.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new OAuthProvider('google.com');\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * provider.addScope('profile');\\r\\n * provider.addScope('email');\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a OAuth Access Token for the provider.\\r\\n *   const credential = provider.credentialFromResult(auth, result);\\r\\n *   const token = credential.accessToken;\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new OAuthProvider('google.com');\\r\\n * provider.addScope('profile');\\r\\n * provider.addScope('email');\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n *\\r\\n * // The signed-in user info.\\r\\n * const user = result.user;\\r\\n * // This gives you a OAuth Access Token for the provider.\\r\\n * const credential = provider.credentialFromResult(auth, result);\\r\\n * const token = credential.accessToken;\\r\\n * ```\\r\\n * @public\\r\\n */\\r\\nclass OAuthProvider extends BaseOAuthProvider {\\r\\n    /**\\r\\n     * Creates an {@link OAuthCredential} from a JSON string or a plain object.\\r\\n     * @param json - A plain object or a JSON string\\r\\n     */\\r\\n    static credentialFromJSON(json) {\\r\\n        const obj = typeof json === 'string' ? JSON.parse(json) : json;\\r\\n        _assert('providerId' in obj && 'signInMethod' in obj, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        return OAuthCredential._fromParams(obj);\\r\\n    }\\r\\n    /**\\r\\n     * Creates a {@link OAuthCredential} from a generic OAuth provider's access token or ID token.\\r\\n     *\\r\\n     * @remarks\\r\\n     * The raw nonce is required when an ID token with a nonce field is provided. The SHA-256 hash of\\r\\n     * the raw nonce must match the nonce field in the ID token.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * // `googleUser` from the onsuccess Google Sign In callback.\\r\\n     * // Initialize a generate OAuth provider with a `google.com` providerId.\\r\\n     * const provider = new OAuthProvider('google.com');\\r\\n     * const credential = provider.credential({\\r\\n     *   idToken: googleUser.getAuthResponse().id_token,\\r\\n     * });\\r\\n     * const result = await signInWithCredential(credential);\\r\\n     * ```\\r\\n     *\\r\\n     * @param params - Either the options object containing the ID token, access token and raw nonce\\r\\n     * or the ID token string.\\r\\n     */\\r\\n    credential(params) {\\r\\n        return this._credential(Object.assign(Object.assign({}, params), { nonce: params.rawNonce }));\\r\\n    }\\r\\n    /** An internal credential method that accepts more permissive options */\\r\\n    _credential(params) {\\r\\n        _assert(params.idToken || params.accessToken, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        // For OAuthCredential, sign in method is same as providerId.\\r\\n        return OAuthCredential._fromParams(Object.assign(Object.assign({}, params), { providerId: this.providerId, signInMethod: this.providerId }));\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        return OAuthProvider.oauthCredentialFromTaggedObject(userCredential);\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\\r\\n     * thrown during a sign-in, link, or reauthenticate operation.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return OAuthProvider.oauthCredentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    static oauthCredentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse) {\\r\\n            return null;\\r\\n        }\\r\\n        const { oauthIdToken, oauthAccessToken, oauthTokenSecret, pendingToken, nonce, providerId } = tokenResponse;\\r\\n        if (!oauthAccessToken &&\\r\\n            !oauthTokenSecret &&\\r\\n            !oauthIdToken &&\\r\\n            !pendingToken) {\\r\\n            return null;\\r\\n        }\\r\\n        if (!providerId) {\\r\\n            return null;\\r\\n        }\\r\\n        try {\\r\\n            return new OAuthProvider(providerId)._credential({\\r\\n                idToken: oauthIdToken,\\r\\n                accessToken: oauthAccessToken,\\r\\n                nonce,\\r\\n                pendingToken\\r\\n            });\\r\\n        }\\r\\n        catch (e) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.FACEBOOK.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * provider.addScope('user_birthday');\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a Facebook Access Token.\\r\\n *   const credential = FacebookAuthProvider.credentialFromResult(result);\\r\\n *   const token = credential.accessToken;\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * provider.addScope('user_birthday');\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n *\\r\\n * // The signed-in user info.\\r\\n * const user = result.user;\\r\\n * // This gives you a Facebook Access Token.\\r\\n * const credential = FacebookAuthProvider.credentialFromResult(result);\\r\\n * const token = credential.accessToken;\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass FacebookAuthProvider extends BaseOAuthProvider {\\r\\n    constructor() {\\r\\n        super(\\\"facebook.com\\\" /* FACEBOOK */);\\r\\n    }\\r\\n    /**\\r\\n     * Creates a credential for Facebook.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * // `event` from the Facebook auth.authResponseChange callback.\\r\\n     * const credential = FacebookAuthProvider.credential(event.authResponse.accessToken);\\r\\n     * const result = await signInWithCredential(credential);\\r\\n     * ```\\r\\n     *\\r\\n     * @param accessToken - Facebook access token.\\r\\n     */\\r\\n    static credential(accessToken) {\\r\\n        return OAuthCredential._fromParams({\\r\\n            providerId: FacebookAuthProvider.PROVIDER_ID,\\r\\n            signInMethod: FacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD,\\r\\n            accessToken\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        return FacebookAuthProvider.credentialFromTaggedObject(userCredential);\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\\r\\n     * thrown during a sign-in, link, or reauthenticate operation.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return FacebookAuthProvider.credentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse || !('oauthAccessToken' in tokenResponse)) {\\r\\n            return null;\\r\\n        }\\r\\n        if (!tokenResponse.oauthAccessToken) {\\r\\n            return null;\\r\\n        }\\r\\n        try {\\r\\n            return FacebookAuthProvider.credential(tokenResponse.oauthAccessToken);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/** Always set to {@link SignInMethod}.FACEBOOK. */\\r\\nFacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD = \\\"facebook.com\\\" /* FACEBOOK */;\\r\\n/** Always set to {@link ProviderId}.FACEBOOK. */\\r\\nFacebookAuthProvider.PROVIDER_ID = \\\"facebook.com\\\" /* FACEBOOK */;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for generating an an {@link OAuthCredential} for {@link ProviderId}.GOOGLE.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new GoogleAuthProvider();\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * provider.addScope('profile');\\r\\n * provider.addScope('email');\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a Google Access Token.\\r\\n *   const credential = GoogleAuthProvider.credentialFromResult(result);\\r\\n *   const token = credential.accessToken;\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new GoogleAuthProvider();\\r\\n * provider.addScope('profile');\\r\\n * provider.addScope('email');\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n *\\r\\n * // The signed-in user info.\\r\\n * const user = result.user;\\r\\n * // This gives you a Google Access Token.\\r\\n * const credential = GoogleAuthProvider.credentialFromResult(result);\\r\\n * const token = credential.accessToken;\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass GoogleAuthProvider extends BaseOAuthProvider {\\r\\n    constructor() {\\r\\n        super(\\\"google.com\\\" /* GOOGLE */);\\r\\n        this.addScope('profile');\\r\\n    }\\r\\n    /**\\r\\n     * Creates a credential for Google. At least one of ID token and access token is required.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * // \\\\`googleUser\\\\` from the onsuccess Google Sign In callback.\\r\\n     * const credential = GoogleAuthProvider.credential(googleUser.getAuthResponse().id_token);\\r\\n     * const result = await signInWithCredential(credential);\\r\\n     * ```\\r\\n     *\\r\\n     * @param idToken - Google ID token.\\r\\n     * @param accessToken - Google access token.\\r\\n     */\\r\\n    static credential(idToken, accessToken) {\\r\\n        return OAuthCredential._fromParams({\\r\\n            providerId: GoogleAuthProvider.PROVIDER_ID,\\r\\n            signInMethod: GoogleAuthProvider.GOOGLE_SIGN_IN_METHOD,\\r\\n            idToken,\\r\\n            accessToken\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        return GoogleAuthProvider.credentialFromTaggedObject(userCredential);\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\\r\\n     * thrown during a sign-in, link, or reauthenticate operation.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return GoogleAuthProvider.credentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse) {\\r\\n            return null;\\r\\n        }\\r\\n        const { oauthIdToken, oauthAccessToken } = tokenResponse;\\r\\n        if (!oauthIdToken && !oauthAccessToken) {\\r\\n            // This could be an oauth 1 credential or a phone credential\\r\\n            return null;\\r\\n        }\\r\\n        try {\\r\\n            return GoogleAuthProvider.credential(oauthIdToken, oauthAccessToken);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/** Always set to {@link SignInMethod}.GOOGLE. */\\r\\nGoogleAuthProvider.GOOGLE_SIGN_IN_METHOD = \\\"google.com\\\" /* GOOGLE */;\\r\\n/** Always set to {@link ProviderId}.GOOGLE. */\\r\\nGoogleAuthProvider.PROVIDER_ID = \\\"google.com\\\" /* GOOGLE */;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GITHUB.\\r\\n *\\r\\n * @remarks\\r\\n * GitHub requires an OAuth 2.0 redirect, so you can either handle the redirect directly, or use\\r\\n * the {@link signInWithPopup} handler:\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new GithubAuthProvider();\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * provider.addScope('repo');\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a Github Access Token.\\r\\n *   const credential = GithubAuthProvider.credentialFromResult(result);\\r\\n *   const token = credential.accessToken;\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new GithubAuthProvider();\\r\\n * provider.addScope('repo');\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n *\\r\\n * // The signed-in user info.\\r\\n * const user = result.user;\\r\\n * // This gives you a Github Access Token.\\r\\n * const credential = GithubAuthProvider.credentialFromResult(result);\\r\\n * const token = credential.accessToken;\\r\\n * ```\\r\\n * @public\\r\\n */\\r\\nclass GithubAuthProvider extends BaseOAuthProvider {\\r\\n    constructor() {\\r\\n        super(\\\"github.com\\\" /* GITHUB */);\\r\\n    }\\r\\n    /**\\r\\n     * Creates a credential for Github.\\r\\n     *\\r\\n     * @param accessToken - Github access token.\\r\\n     */\\r\\n    static credential(accessToken) {\\r\\n        return OAuthCredential._fromParams({\\r\\n            providerId: GithubAuthProvider.PROVIDER_ID,\\r\\n            signInMethod: GithubAuthProvider.GITHUB_SIGN_IN_METHOD,\\r\\n            accessToken\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        return GithubAuthProvider.credentialFromTaggedObject(userCredential);\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\\r\\n     * thrown during a sign-in, link, or reauthenticate operation.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return GithubAuthProvider.credentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse || !('oauthAccessToken' in tokenResponse)) {\\r\\n            return null;\\r\\n        }\\r\\n        if (!tokenResponse.oauthAccessToken) {\\r\\n            return null;\\r\\n        }\\r\\n        try {\\r\\n            return GithubAuthProvider.credential(tokenResponse.oauthAccessToken);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/** Always set to {@link SignInMethod}.GITHUB. */\\r\\nGithubAuthProvider.GITHUB_SIGN_IN_METHOD = \\\"github.com\\\" /* GITHUB */;\\r\\n/** Always set to {@link ProviderId}.GITHUB. */\\r\\nGithubAuthProvider.PROVIDER_ID = \\\"github.com\\\" /* GITHUB */;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst IDP_REQUEST_URI = 'http://localhost';\\r\\n/**\\r\\n * @public\\r\\n */\\r\\nclass SAMLAuthCredential extends AuthCredential {\\r\\n    /** @internal */\\r\\n    constructor(providerId, pendingToken) {\\r\\n        super(providerId, providerId);\\r\\n        this.pendingToken = pendingToken;\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getIdTokenResponse(auth) {\\r\\n        const request = this.buildRequest();\\r\\n        return signInWithIdp(auth, request);\\r\\n    }\\r\\n    /** @internal */\\r\\n    _linkToIdToken(auth, idToken) {\\r\\n        const request = this.buildRequest();\\r\\n        request.idToken = idToken;\\r\\n        return signInWithIdp(auth, request);\\r\\n    }\\r\\n    /** @internal */\\r\\n    _getReauthenticationResolver(auth) {\\r\\n        const request = this.buildRequest();\\r\\n        request.autoCreate = false;\\r\\n        return signInWithIdp(auth, request);\\r\\n    }\\r\\n    /** {@inheritdoc AuthCredential.toJSON}  */\\r\\n    toJSON() {\\r\\n        return {\\r\\n            signInMethod: this.signInMethod,\\r\\n            providerId: this.providerId,\\r\\n            pendingToken: this.pendingToken\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Static method to deserialize a JSON representation of an object into an\\r\\n     * {@link  AuthCredential}.\\r\\n     *\\r\\n     * @param json - Input can be either Object or the stringified representation of the object.\\r\\n     * When string is provided, JSON.parse would be called first.\\r\\n     *\\r\\n     * @returns If the JSON input does not represent an {@link  AuthCredential}, null is returned.\\r\\n     */\\r\\n    static fromJSON(json) {\\r\\n        const obj = typeof json === 'string' ? JSON.parse(json) : json;\\r\\n        const { providerId, signInMethod, pendingToken } = obj;\\r\\n        if (!providerId ||\\r\\n            !signInMethod ||\\r\\n            !pendingToken ||\\r\\n            providerId !== signInMethod) {\\r\\n            return null;\\r\\n        }\\r\\n        return new SAMLAuthCredential(providerId, pendingToken);\\r\\n    }\\r\\n    /**\\r\\n     * Helper static method to avoid exposing the constructor to end users.\\r\\n     *\\r\\n     * @internal\\r\\n     */\\r\\n    static _create(providerId, pendingToken) {\\r\\n        return new SAMLAuthCredential(providerId, pendingToken);\\r\\n    }\\r\\n    buildRequest() {\\r\\n        return {\\r\\n            requestUri: IDP_REQUEST_URI,\\r\\n            returnSecureToken: true,\\r\\n            pendingToken: this.pendingToken\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst SAML_PROVIDER_PREFIX = 'saml.';\\r\\n/**\\r\\n * An {@link AuthProvider} for SAML.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass SAMLAuthProvider extends FederatedAuthProvider {\\r\\n    /**\\r\\n     * Constructor. The providerId must start with \\\"saml.\\\"\\r\\n     * @param providerId - SAML provider ID.\\r\\n     */\\r\\n    constructor(providerId) {\\r\\n        _assert(providerId.startsWith(SAML_PROVIDER_PREFIX), \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        super(providerId);\\r\\n    }\\r\\n    /**\\r\\n     * Generates an {@link AuthCredential} from a {@link UserCredential} after a\\r\\n     * successful SAML flow completes.\\r\\n     *\\r\\n     * @remarks\\r\\n     *\\r\\n     * For example, to get an {@link AuthCredential}, you could write the\\r\\n     * following code:\\r\\n     *\\r\\n     * ```js\\r\\n     * const userCredential = await signInWithPopup(auth, samlProvider);\\r\\n     * const credential = SAMLAuthProvider.credentialFromResult(userCredential);\\r\\n     * ```\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        return SAMLAuthProvider.samlCredentialFromTaggedObject(userCredential);\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\\r\\n     * thrown during a sign-in, link, or reauthenticate operation.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return SAMLAuthProvider.samlCredentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    /**\\r\\n     * Creates an {@link AuthCredential} from a JSON string or a plain object.\\r\\n     * @param json - A plain object or a JSON string\\r\\n     */\\r\\n    static credentialFromJSON(json) {\\r\\n        const credential = SAMLAuthCredential.fromJSON(json);\\r\\n        _assert(credential, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        return credential;\\r\\n    }\\r\\n    static samlCredentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse) {\\r\\n            return null;\\r\\n        }\\r\\n        const { pendingToken, providerId } = tokenResponse;\\r\\n        if (!pendingToken || !providerId) {\\r\\n            return null;\\r\\n        }\\r\\n        try {\\r\\n            return SAMLAuthCredential._create(providerId, pendingToken);\\r\\n        }\\r\\n        catch (e) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.TWITTER.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new TwitterAuthProvider();\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a Twitter Access Token and Secret.\\r\\n *   const credential = TwitterAuthProvider.credentialFromResult(result);\\r\\n *   const token = credential.accessToken;\\r\\n *   const secret = credential.secret;\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new TwitterAuthProvider();\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n *\\r\\n * // The signed-in user info.\\r\\n * const user = result.user;\\r\\n * // This gives you a Twitter Access Token and Secret.\\r\\n * const credential = TwitterAuthProvider.credentialFromResult(result);\\r\\n * const token = credential.accessToken;\\r\\n * const secret = credential.secret;\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass TwitterAuthProvider extends BaseOAuthProvider {\\r\\n    constructor() {\\r\\n        super(\\\"twitter.com\\\" /* TWITTER */);\\r\\n    }\\r\\n    /**\\r\\n     * Creates a credential for Twitter.\\r\\n     *\\r\\n     * @param token - Twitter access token.\\r\\n     * @param secret - Twitter secret.\\r\\n     */\\r\\n    static credential(token, secret) {\\r\\n        return OAuthCredential._fromParams({\\r\\n            providerId: TwitterAuthProvider.PROVIDER_ID,\\r\\n            signInMethod: TwitterAuthProvider.TWITTER_SIGN_IN_METHOD,\\r\\n            oauthToken: token,\\r\\n            oauthTokenSecret: secret\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        return TwitterAuthProvider.credentialFromTaggedObject(userCredential);\\r\\n    }\\r\\n    /**\\r\\n     * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\\r\\n     * thrown during a sign-in, link, or reauthenticate operation.\\r\\n     *\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return TwitterAuthProvider.credentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse) {\\r\\n            return null;\\r\\n        }\\r\\n        const { oauthAccessToken, oauthTokenSecret } = tokenResponse;\\r\\n        if (!oauthAccessToken || !oauthTokenSecret) {\\r\\n            return null;\\r\\n        }\\r\\n        try {\\r\\n            return TwitterAuthProvider.credential(oauthAccessToken, oauthTokenSecret);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            return null;\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/** Always set to {@link SignInMethod}.TWITTER. */\\r\\nTwitterAuthProvider.TWITTER_SIGN_IN_METHOD = \\\"twitter.com\\\" /* TWITTER */;\\r\\n/** Always set to {@link ProviderId}.TWITTER. */\\r\\nTwitterAuthProvider.PROVIDER_ID = \\\"twitter.com\\\" /* TWITTER */;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function signUp(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signUp\\\" /* SIGN_UP */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass UserCredentialImpl {\\r\\n    constructor(params) {\\r\\n        this.user = params.user;\\r\\n        this.providerId = params.providerId;\\r\\n        this._tokenResponse = params._tokenResponse;\\r\\n        this.operationType = params.operationType;\\r\\n    }\\r\\n    static async _fromIdTokenResponse(auth, operationType, idTokenResponse, isAnonymous = false) {\\r\\n        const user = await UserImpl._fromIdTokenResponse(auth, idTokenResponse, isAnonymous);\\r\\n        const providerId = providerIdForResponse(idTokenResponse);\\r\\n        const userCred = new UserCredentialImpl({\\r\\n            user,\\r\\n            providerId,\\r\\n            _tokenResponse: idTokenResponse,\\r\\n            operationType\\r\\n        });\\r\\n        return userCred;\\r\\n    }\\r\\n    static async _forOperation(user, operationType, response) {\\r\\n        await user._updateTokensIfNecessary(response, /* reload */ true);\\r\\n        const providerId = providerIdForResponse(response);\\r\\n        return new UserCredentialImpl({\\r\\n            user,\\r\\n            providerId,\\r\\n            _tokenResponse: response,\\r\\n            operationType\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction providerIdForResponse(response) {\\r\\n    if (response.providerId) {\\r\\n        return response.providerId;\\r\\n    }\\r\\n    if ('phoneNumber' in response) {\\r\\n        return \\\"phone\\\" /* PHONE */;\\r\\n    }\\r\\n    return null;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Asynchronously signs in as an anonymous user.\\r\\n *\\r\\n * @remarks\\r\\n * If there is already an anonymous user signed in, that user will be returned; otherwise, a\\r\\n * new anonymous user identity will be created and returned.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function signInAnonymously(auth) {\\r\\n    var _a;\\r\\n    const authInternal = _castAuth(auth);\\r\\n    await authInternal._initializationPromise;\\r\\n    if ((_a = authInternal.currentUser) === null || _a === void 0 ? void 0 : _a.isAnonymous) {\\r\\n        // If an anonymous user is already signed in, no need to sign them in again.\\r\\n        return new UserCredentialImpl({\\r\\n            user: authInternal.currentUser,\\r\\n            providerId: null,\\r\\n            operationType: \\\"signIn\\\" /* SIGN_IN */\\r\\n        });\\r\\n    }\\r\\n    const response = await signUp(authInternal, {\\r\\n        returnSecureToken: true\\r\\n    });\\r\\n    const userCredential = await UserCredentialImpl._fromIdTokenResponse(authInternal, \\\"signIn\\\" /* SIGN_IN */, response, true);\\r\\n    await authInternal._updateCurrentUser(userCredential.user);\\r\\n    return userCredential;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass MultiFactorError extends _firebase_util__WEBPACK_IMPORTED_MODULE_0__.FirebaseError {\\r\\n    constructor(auth, error, operationType, user) {\\r\\n        var _a;\\r\\n        super(error.code, error.message);\\r\\n        this.operationType = operationType;\\r\\n        this.user = user;\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, MultiFactorError.prototype);\\r\\n        this.customData = {\\r\\n            appName: auth.name,\\r\\n            tenantId: (_a = auth.tenantId) !== null && _a !== void 0 ? _a : undefined,\\r\\n            _serverResponse: error.customData._serverResponse,\\r\\n            operationType,\\r\\n        };\\r\\n    }\\r\\n    static _fromErrorAndOperation(auth, error, operationType, user) {\\r\\n        return new MultiFactorError(auth, error, operationType, user);\\r\\n    }\\r\\n}\\r\\nfunction _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user) {\\r\\n    const idTokenProvider = operationType === \\\"reauthenticate\\\" /* REAUTHENTICATE */\\r\\n        ? credential._getReauthenticationResolver(auth)\\r\\n        : credential._getIdTokenResponse(auth);\\r\\n    return idTokenProvider.catch(error => {\\r\\n        if (error.code === `auth/${\\\"multi-factor-auth-required\\\" /* MFA_REQUIRED */}`) {\\r\\n            throw MultiFactorError._fromErrorAndOperation(auth, error, operationType, user);\\r\\n        }\\r\\n        throw error;\\r\\n    });\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Takes a set of UserInfo provider data and converts it to a set of names\\r\\n */\\r\\nfunction providerDataAsNames(providerData) {\\r\\n    return new Set(providerData\\r\\n        .map(({ providerId }) => providerId)\\r\\n        .filter(pid => !!pid));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Unlinks a provider from a user account.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param providerId - The provider to unlink.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function unlink(user, providerId) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    await _assertLinkedStatus(true, userInternal, providerId);\\r\\n    const { providerUserInfo } = await deleteLinkedAccounts(userInternal.auth, {\\r\\n        idToken: await userInternal.getIdToken(),\\r\\n        deleteProvider: [providerId]\\r\\n    });\\r\\n    const providersLeft = providerDataAsNames(providerUserInfo || []);\\r\\n    userInternal.providerData = userInternal.providerData.filter(pd => providersLeft.has(pd.providerId));\\r\\n    if (!providersLeft.has(\\\"phone\\\" /* PHONE */)) {\\r\\n        userInternal.phoneNumber = null;\\r\\n    }\\r\\n    await userInternal.auth._persistUserIfCurrent(userInternal);\\r\\n    return userInternal;\\r\\n}\\r\\nasync function _link$1(user, credential, bypassAuthState = false) {\\r\\n    const response = await _logoutIfInvalidated(user, credential._linkToIdToken(user.auth, await user.getIdToken()), bypassAuthState);\\r\\n    return UserCredentialImpl._forOperation(user, \\\"link\\\" /* LINK */, response);\\r\\n}\\r\\nasync function _assertLinkedStatus(expected, user, provider) {\\r\\n    await _reloadWithoutSaving(user);\\r\\n    const providerIds = providerDataAsNames(user.providerData);\\r\\n    const code = expected === false\\r\\n        ? \\\"provider-already-linked\\\" /* PROVIDER_ALREADY_LINKED */\\r\\n        : \\\"no-such-provider\\\" /* NO_SUCH_PROVIDER */;\\r\\n    _assert(providerIds.has(provider) === expected, user.auth, code);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function _reauthenticate(user, credential, bypassAuthState = false) {\\r\\n    const { auth } = user;\\r\\n    const operationType = \\\"reauthenticate\\\" /* REAUTHENTICATE */;\\r\\n    try {\\r\\n        const response = await _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState);\\r\\n        _assert(response.idToken, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        const parsed = _parseToken(response.idToken);\\r\\n        _assert(parsed, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        const { sub: localId } = parsed;\\r\\n        _assert(user.uid === localId, auth, \\\"user-mismatch\\\" /* USER_MISMATCH */);\\r\\n        return UserCredentialImpl._forOperation(user, operationType, response);\\r\\n    }\\r\\n    catch (e) {\\r\\n        // Convert user deleted error into user mismatch\\r\\n        if ((e === null || e === void 0 ? void 0 : e.code) === `auth/${\\\"user-not-found\\\" /* USER_DELETED */}`) {\\r\\n            _fail(auth, \\\"user-mismatch\\\" /* USER_MISMATCH */);\\r\\n        }\\r\\n        throw e;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function _signInWithCredential(auth, credential, bypassAuthState = false) {\\r\\n    const operationType = \\\"signIn\\\" /* SIGN_IN */;\\r\\n    const response = await _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential);\\r\\n    const userCredential = await UserCredentialImpl._fromIdTokenResponse(auth, operationType, response);\\r\\n    if (!bypassAuthState) {\\r\\n        await auth._updateCurrentUser(userCredential.user);\\r\\n    }\\r\\n    return userCredential;\\r\\n}\\r\\n/**\\r\\n * Asynchronously signs in with the given credentials.\\r\\n *\\r\\n * @remarks\\r\\n * An {@link AuthProvider} can be used to generate the credential.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param credential - The auth credential.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function signInWithCredential(auth, credential) {\\r\\n    return _signInWithCredential(_castAuth(auth), credential);\\r\\n}\\r\\n/**\\r\\n * Links the user account with the given credentials.\\r\\n *\\r\\n * @remarks\\r\\n * An {@link AuthProvider} can be used to generate the credential.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param credential - The auth credential.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function linkWithCredential(user, credential) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    await _assertLinkedStatus(false, userInternal, credential.providerId);\\r\\n    return _link$1(userInternal, credential);\\r\\n}\\r\\n/**\\r\\n * Re-authenticates a user using a fresh credential.\\r\\n *\\r\\n * @remarks\\r\\n * Use before operations such as {@link updatePassword} that require tokens from recent sign-in\\r\\n * attempts. This method can be used to recover from a `CREDENTIAL_TOO_OLD_LOGIN_AGAIN` error.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param credential - The auth credential.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function reauthenticateWithCredential(user, credential) {\\r\\n    return _reauthenticate((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user), credential);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function signInWithCustomToken$1(auth, request) {\\r\\n    return _performSignInRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:signInWithCustomToken\\\" /* SIGN_IN_WITH_CUSTOM_TOKEN */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Asynchronously signs in using a custom token.\\r\\n *\\r\\n * @remarks\\r\\n * Custom tokens are used to integrate Firebase Auth with existing auth systems, and must\\r\\n * be generated by an auth backend using the\\r\\n * {@link https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#createcustomtoken | createCustomToken}\\r\\n * method in the {@link https://firebase.google.com/docs/auth/admin | Admin SDK} .\\r\\n *\\r\\n * Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param customToken - The custom token to sign in with.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function signInWithCustomToken(auth, customToken) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    const response = await signInWithCustomToken$1(authInternal, {\\r\\n        token: customToken,\\r\\n        returnSecureToken: true\\r\\n    });\\r\\n    const cred = await UserCredentialImpl._fromIdTokenResponse(authInternal, \\\"signIn\\\" /* SIGN_IN */, response);\\r\\n    await authInternal._updateCurrentUser(cred.user);\\r\\n    return cred;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass MultiFactorInfoImpl {\\r\\n    constructor(factorId, response) {\\r\\n        this.factorId = factorId;\\r\\n        this.uid = response.mfaEnrollmentId;\\r\\n        this.enrollmentTime = new Date(response.enrolledAt).toUTCString();\\r\\n        this.displayName = response.displayName;\\r\\n    }\\r\\n    static _fromServerResponse(auth, enrollment) {\\r\\n        if ('phoneInfo' in enrollment) {\\r\\n            return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);\\r\\n        }\\r\\n        return _fail(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    }\\r\\n}\\r\\nclass PhoneMultiFactorInfoImpl extends MultiFactorInfoImpl {\\r\\n    constructor(response) {\\r\\n        super(\\\"phone\\\" /* PHONE */, response);\\r\\n        this.phoneNumber = response.phoneInfo;\\r\\n    }\\r\\n    static _fromServerResponse(_auth, enrollment) {\\r\\n        return new PhoneMultiFactorInfoImpl(enrollment);\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _setActionCodeSettingsOnRequest(auth, request, actionCodeSettings) {\\r\\n    var _a;\\r\\n    _assert(((_a = actionCodeSettings.url) === null || _a === void 0 ? void 0 : _a.length) > 0, auth, \\\"invalid-continue-uri\\\" /* INVALID_CONTINUE_URI */);\\r\\n    _assert(typeof actionCodeSettings.dynamicLinkDomain === 'undefined' ||\\r\\n        actionCodeSettings.dynamicLinkDomain.length > 0, auth, \\\"invalid-dynamic-link-domain\\\" /* INVALID_DYNAMIC_LINK_DOMAIN */);\\r\\n    request.continueUrl = actionCodeSettings.url;\\r\\n    request.dynamicLinkDomain = actionCodeSettings.dynamicLinkDomain;\\r\\n    request.canHandleCodeInApp = actionCodeSettings.handleCodeInApp;\\r\\n    if (actionCodeSettings.iOS) {\\r\\n        _assert(actionCodeSettings.iOS.bundleId.length > 0, auth, \\\"missing-ios-bundle-id\\\" /* MISSING_IOS_BUNDLE_ID */);\\r\\n        request.iOSBundleId = actionCodeSettings.iOS.bundleId;\\r\\n    }\\r\\n    if (actionCodeSettings.android) {\\r\\n        _assert(actionCodeSettings.android.packageName.length > 0, auth, \\\"missing-android-pkg-name\\\" /* MISSING_ANDROID_PACKAGE_NAME */);\\r\\n        request.androidInstallApp = actionCodeSettings.android.installApp;\\r\\n        request.androidMinimumVersionCode =\\r\\n            actionCodeSettings.android.minimumVersion;\\r\\n        request.androidPackageName = actionCodeSettings.android.packageName;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Sends a password reset email to the given email address.\\r\\n *\\r\\n * @remarks\\r\\n * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in\\r\\n * the email sent to the user, along with the new password specified by the user.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * const actionCodeSettings = {\\r\\n *   url: 'https://www.example.com/?email=user@example.com',\\r\\n *   iOS: {\\r\\n *      bundleId: 'com.example.ios'\\r\\n *   },\\r\\n *   android: {\\r\\n *     packageName: 'com.example.android',\\r\\n *     installApp: true,\\r\\n *     minimumVersion: '12'\\r\\n *   },\\r\\n *   handleCodeInApp: true\\r\\n * };\\r\\n * await sendPasswordResetEmail(auth, 'user@example.com', actionCodeSettings);\\r\\n * // Obtain code from user.\\r\\n * await confirmPasswordReset('user@example.com', code);\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param email - The user's email address.\\r\\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function sendPasswordResetEmail(auth, email, actionCodeSettings) {\\r\\n    const authModular = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\\r\\n    const request = {\\r\\n        requestType: \\\"PASSWORD_RESET\\\" /* PASSWORD_RESET */,\\r\\n        email\\r\\n    };\\r\\n    if (actionCodeSettings) {\\r\\n        _setActionCodeSettingsOnRequest(authModular, request, actionCodeSettings);\\r\\n    }\\r\\n    await sendPasswordResetEmail$1(authModular, request);\\r\\n}\\r\\n/**\\r\\n * Completes the password reset process, given a confirmation code and new password.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param oobCode - A confirmation code sent to the user.\\r\\n * @param newPassword - The new password.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function confirmPasswordReset(auth, oobCode, newPassword) {\\r\\n    await resetPassword((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth), {\\r\\n        oobCode,\\r\\n        newPassword\\r\\n    });\\r\\n    // Do not return the email.\\r\\n}\\r\\n/**\\r\\n * Applies a verification code sent to the user by email or other out-of-band mechanism.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param oobCode - A verification code sent to the user.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function applyActionCode(auth, oobCode) {\\r\\n    await applyActionCode$1((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth), { oobCode });\\r\\n}\\r\\n/**\\r\\n * Checks a verification code sent to the user by email or other out-of-band mechanism.\\r\\n *\\r\\n * @returns metadata about the code.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param oobCode - A verification code sent to the user.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function checkActionCode(auth, oobCode) {\\r\\n    const authModular = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\\r\\n    const response = await resetPassword(authModular, { oobCode });\\r\\n    // Email could be empty only if the request type is EMAIL_SIGNIN or\\r\\n    // VERIFY_AND_CHANGE_EMAIL.\\r\\n    // New email should not be empty if the request type is\\r\\n    // VERIFY_AND_CHANGE_EMAIL.\\r\\n    // Multi-factor info could not be empty if the request type is\\r\\n    // REVERT_SECOND_FACTOR_ADDITION.\\r\\n    const operation = response.requestType;\\r\\n    _assert(operation, authModular, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    switch (operation) {\\r\\n        case \\\"EMAIL_SIGNIN\\\" /* EMAIL_SIGNIN */:\\r\\n            break;\\r\\n        case \\\"VERIFY_AND_CHANGE_EMAIL\\\" /* VERIFY_AND_CHANGE_EMAIL */:\\r\\n            _assert(response.newEmail, authModular, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n            break;\\r\\n        case \\\"REVERT_SECOND_FACTOR_ADDITION\\\" /* REVERT_SECOND_FACTOR_ADDITION */:\\r\\n            _assert(response.mfaInfo, authModular, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        // fall through\\r\\n        default:\\r\\n            _assert(response.email, authModular, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    }\\r\\n    // The multi-factor info for revert second factor addition\\r\\n    let multiFactorInfo = null;\\r\\n    if (response.mfaInfo) {\\r\\n        multiFactorInfo = MultiFactorInfoImpl._fromServerResponse(_castAuth(authModular), response.mfaInfo);\\r\\n    }\\r\\n    return {\\r\\n        data: {\\r\\n            email: (response.requestType === \\\"VERIFY_AND_CHANGE_EMAIL\\\" /* VERIFY_AND_CHANGE_EMAIL */\\r\\n                ? response.newEmail\\r\\n                : response.email) || null,\\r\\n            previousEmail: (response.requestType === \\\"VERIFY_AND_CHANGE_EMAIL\\\" /* VERIFY_AND_CHANGE_EMAIL */\\r\\n                ? response.email\\r\\n                : response.newEmail) || null,\\r\\n            multiFactorInfo\\r\\n        },\\r\\n        operation\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Checks a password reset code sent to the user by email or other out-of-band mechanism.\\r\\n *\\r\\n * @returns the user's email address if valid.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param code - A verification code sent to the user.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function verifyPasswordResetCode(auth, code) {\\r\\n    const { data } = await checkActionCode((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth), code);\\r\\n    // Email should always be present since a code was sent to it\\r\\n    return data.email;\\r\\n}\\r\\n/**\\r\\n * Creates a new user account associated with the specified email address and password.\\r\\n *\\r\\n * @remarks\\r\\n * On successful creation of the user account, this user will also be signed in to your application.\\r\\n *\\r\\n * User account creation can fail if the account already exists or the password is invalid.\\r\\n *\\r\\n * Note: The email address acts as a unique identifier for the user and enables an email-based\\r\\n * password reset. This function will create a new user account and set the initial user password.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param email - The user's email address.\\r\\n * @param password - The user's chosen password.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function createUserWithEmailAndPassword(auth, email, password) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    const response = await signUp(authInternal, {\\r\\n        returnSecureToken: true,\\r\\n        email,\\r\\n        password\\r\\n    });\\r\\n    const userCredential = await UserCredentialImpl._fromIdTokenResponse(authInternal, \\\"signIn\\\" /* SIGN_IN */, response);\\r\\n    await authInternal._updateCurrentUser(userCredential.user);\\r\\n    return userCredential;\\r\\n}\\r\\n/**\\r\\n * Asynchronously signs in using an email and password.\\r\\n *\\r\\n * @remarks\\r\\n * Fails with an error if the email address and password do not match.\\r\\n *\\r\\n * Note: The user's password is NOT the password used to access the user's email account. The\\r\\n * email address serves as a unique identifier for the user, and the password is used to access\\r\\n * the user's account in your Firebase project. See also: {@link createUserWithEmailAndPassword}.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param email - The users email address.\\r\\n * @param password - The users password.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction signInWithEmailAndPassword(auth, email, password) {\\r\\n    return signInWithCredential((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth), EmailAuthProvider.credential(email, password));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Sends a sign-in email link to the user with the specified email.\\r\\n *\\r\\n * @remarks\\r\\n * The sign-in operation has to always be completed in the app unlike other out of band email\\r\\n * actions (password reset and email verifications). This is because, at the end of the flow,\\r\\n * the user is expected to be signed in and their Auth state persisted within the app.\\r\\n *\\r\\n * To complete sign in with the email link, call {@link signInWithEmailLink} with the email\\r\\n * address and the email link supplied in the email sent to the user.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * const actionCodeSettings = {\\r\\n *   url: 'https://www.example.com/?email=user@example.com',\\r\\n *   iOS: {\\r\\n *      bundleId: 'com.example.ios'\\r\\n *   },\\r\\n *   android: {\\r\\n *     packageName: 'com.example.android',\\r\\n *     installApp: true,\\r\\n *     minimumVersion: '12'\\r\\n *   },\\r\\n *   handleCodeInApp: true\\r\\n * };\\r\\n * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings);\\r\\n * // Obtain emailLink from the user.\\r\\n * if(isSignInWithEmailLink(auth, emailLink)) {\\r\\n *   await signInWithEmailLink(auth, 'user@example.com', emailLink);\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @param authInternal - The {@link Auth} instance.\\r\\n * @param email - The user's email address.\\r\\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function sendSignInLinkToEmail(auth, email, actionCodeSettings) {\\r\\n    const authModular = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\\r\\n    const request = {\\r\\n        requestType: \\\"EMAIL_SIGNIN\\\" /* EMAIL_SIGNIN */,\\r\\n        email\\r\\n    };\\r\\n    _assert(actionCodeSettings.handleCodeInApp, authModular, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n    if (actionCodeSettings) {\\r\\n        _setActionCodeSettingsOnRequest(authModular, request, actionCodeSettings);\\r\\n    }\\r\\n    await sendSignInLinkToEmail$1(authModular, request);\\r\\n}\\r\\n/**\\r\\n * Checks if an incoming link is a sign-in with email link suitable for {@link signInWithEmailLink}.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param emailLink - The link sent to the user's email address.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction isSignInWithEmailLink(auth, emailLink) {\\r\\n    const actionCodeUrl = ActionCodeURL.parseLink(emailLink);\\r\\n    return (actionCodeUrl === null || actionCodeUrl === void 0 ? void 0 : actionCodeUrl.operation) === \\\"EMAIL_SIGNIN\\\" /* EMAIL_SIGNIN */;\\r\\n}\\r\\n/**\\r\\n * Asynchronously signs in using an email and sign-in email link.\\r\\n *\\r\\n * @remarks\\r\\n * If no link is passed, the link is inferred from the current URL.\\r\\n *\\r\\n * Fails with an error if the email address is invalid or OTP in email link expires.\\r\\n *\\r\\n * Note: Confirm the link is a sign-in email link before calling this method firebase.auth.Auth.isSignInWithEmailLink.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * const actionCodeSettings = {\\r\\n *   url: 'https://www.example.com/?email=user@example.com',\\r\\n *   iOS: {\\r\\n *      bundleId: 'com.example.ios'\\r\\n *   },\\r\\n *   android: {\\r\\n *     packageName: 'com.example.android',\\r\\n *     installApp: true,\\r\\n *     minimumVersion: '12'\\r\\n *   },\\r\\n *   handleCodeInApp: true\\r\\n * };\\r\\n * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings);\\r\\n * // Obtain emailLink from the user.\\r\\n * if(isSignInWithEmailLink(auth, emailLink)) {\\r\\n *   await signInWithEmailLink(auth, 'user@example.com', emailLink);\\r\\n * }\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param email - The user's email address.\\r\\n * @param emailLink - The link sent to the user's email address.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function signInWithEmailLink(auth, email, emailLink) {\\r\\n    const authModular = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\\r\\n    const credential = EmailAuthProvider.credentialWithLink(email, emailLink || _getCurrentUrl());\\r\\n    // Check if the tenant ID in the email link matches the tenant ID on Auth\\r\\n    // instance.\\r\\n    _assert(credential._tenantId === (authModular.tenantId || null), authModular, \\\"tenant-id-mismatch\\\" /* TENANT_ID_MISMATCH */);\\r\\n    return signInWithCredential(authModular, credential);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function createAuthUri(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:createAuthUri\\\" /* CREATE_AUTH_URI */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Gets the list of possible sign in methods for the given email address.\\r\\n *\\r\\n * @remarks\\r\\n * This is useful to differentiate methods of sign-in for the same provider, eg.\\r\\n * {@link EmailAuthProvider} which has 2 methods of sign-in,\\r\\n * {@link SignInMethod}.EMAIL_PASSWORD and\\r\\n * {@link SignInMethod}.EMAIL_LINK.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param email - The user's email address.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function fetchSignInMethodsForEmail(auth, email) {\\r\\n    // createAuthUri returns an error if continue URI is not http or https.\\r\\n    // For environments like Cordova, Chrome extensions, native frameworks, file\\r\\n    // systems, etc, use http://localhost as continue URL.\\r\\n    const continueUri = _isHttpOrHttps() ? _getCurrentUrl() : 'http://localhost';\\r\\n    const request = {\\r\\n        identifier: email,\\r\\n        continueUri\\r\\n    };\\r\\n    const { signinMethods } = await createAuthUri((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth), request);\\r\\n    return signinMethods || [];\\r\\n}\\r\\n/**\\r\\n * Sends a verification email to a user.\\r\\n *\\r\\n * @remarks\\r\\n * The verification process is completed by calling {@link applyActionCode}.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * const actionCodeSettings = {\\r\\n *   url: 'https://www.example.com/?email=user@example.com',\\r\\n *   iOS: {\\r\\n *      bundleId: 'com.example.ios'\\r\\n *   },\\r\\n *   android: {\\r\\n *     packageName: 'com.example.android',\\r\\n *     installApp: true,\\r\\n *     minimumVersion: '12'\\r\\n *   },\\r\\n *   handleCodeInApp: true\\r\\n * };\\r\\n * await sendEmailVerification(user, actionCodeSettings);\\r\\n * // Obtain code from the user.\\r\\n * await applyActionCode(auth, code);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function sendEmailVerification(user, actionCodeSettings) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    const idToken = await user.getIdToken();\\r\\n    const request = {\\r\\n        requestType: \\\"VERIFY_EMAIL\\\" /* VERIFY_EMAIL */,\\r\\n        idToken\\r\\n    };\\r\\n    if (actionCodeSettings) {\\r\\n        _setActionCodeSettingsOnRequest(userInternal.auth, request, actionCodeSettings);\\r\\n    }\\r\\n    const { email } = await sendEmailVerification$1(userInternal.auth, request);\\r\\n    if (email !== user.email) {\\r\\n        await user.reload();\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Sends a verification email to a new email address.\\r\\n *\\r\\n * @remarks\\r\\n * The user's email will be updated to the new one after being verified.\\r\\n *\\r\\n * If you have a custom email action handler, you can complete the verification process by calling\\r\\n * {@link applyActionCode}.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * const actionCodeSettings = {\\r\\n *   url: 'https://www.example.com/?email=user@example.com',\\r\\n *   iOS: {\\r\\n *      bundleId: 'com.example.ios'\\r\\n *   },\\r\\n *   android: {\\r\\n *     packageName: 'com.example.android',\\r\\n *     installApp: true,\\r\\n *     minimumVersion: '12'\\r\\n *   },\\r\\n *   handleCodeInApp: true\\r\\n * };\\r\\n * await verifyBeforeUpdateEmail(user, 'newemail@example.com', actionCodeSettings);\\r\\n * // Obtain code from the user.\\r\\n * await applyActionCode(auth, code);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param newEmail - The new email address to be verified before update.\\r\\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function verifyBeforeUpdateEmail(user, newEmail, actionCodeSettings) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    const idToken = await user.getIdToken();\\r\\n    const request = {\\r\\n        requestType: \\\"VERIFY_AND_CHANGE_EMAIL\\\" /* VERIFY_AND_CHANGE_EMAIL */,\\r\\n        idToken,\\r\\n        newEmail\\r\\n    };\\r\\n    if (actionCodeSettings) {\\r\\n        _setActionCodeSettingsOnRequest(userInternal.auth, request, actionCodeSettings);\\r\\n    }\\r\\n    const { email } = await verifyAndChangeEmail(userInternal.auth, request);\\r\\n    if (email !== user.email) {\\r\\n        // If the local copy of the email on user is outdated, reload the\\r\\n        // user.\\r\\n        await user.reload();\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function updateProfile$1(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v1/accounts:update\\\" /* SET_ACCOUNT_INFO */, request);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Updates a user's profile data.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param profile - The profile's `displayName` and `photoURL` to update.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function updateProfile(user, { displayName, photoURL: photoUrl }) {\\r\\n    if (displayName === undefined && photoUrl === undefined) {\\r\\n        return;\\r\\n    }\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    const idToken = await userInternal.getIdToken();\\r\\n    const profileRequest = {\\r\\n        idToken,\\r\\n        displayName,\\r\\n        photoUrl,\\r\\n        returnSecureToken: true\\r\\n    };\\r\\n    const response = await _logoutIfInvalidated(userInternal, updateProfile$1(userInternal.auth, profileRequest));\\r\\n    userInternal.displayName = response.displayName || null;\\r\\n    userInternal.photoURL = response.photoUrl || null;\\r\\n    // Update the password provider as well\\r\\n    const passwordProvider = userInternal.providerData.find(({ providerId }) => providerId === \\\"password\\\" /* PASSWORD */);\\r\\n    if (passwordProvider) {\\r\\n        passwordProvider.displayName = userInternal.displayName;\\r\\n        passwordProvider.photoURL = userInternal.photoURL;\\r\\n    }\\r\\n    await userInternal._updateTokensIfNecessary(response);\\r\\n}\\r\\n/**\\r\\n * Updates the user's email address.\\r\\n *\\r\\n * @remarks\\r\\n * An email will be sent to the original email address (if it was set) that allows to revoke the\\r\\n * email address change, in order to protect them from account hijacking.\\r\\n *\\r\\n * Important: this is a security sensitive operation that requires the user to have recently signed\\r\\n * in. If this requirement isn't met, ask the user to authenticate again and then call\\r\\n * {@link reauthenticateWithCredential}.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param newEmail - The new email address.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction updateEmail(user, newEmail) {\\r\\n    return updateEmailOrPassword((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user), newEmail, null);\\r\\n}\\r\\n/**\\r\\n * Updates the user's password.\\r\\n *\\r\\n * @remarks\\r\\n * Important: this is a security sensitive operation that requires the user to have recently signed\\r\\n * in. If this requirement isn't met, ask the user to authenticate again and then call\\r\\n * {@link reauthenticateWithCredential}.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param newPassword - The new password.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction updatePassword(user, newPassword) {\\r\\n    return updateEmailOrPassword((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user), null, newPassword);\\r\\n}\\r\\nasync function updateEmailOrPassword(user, email, password) {\\r\\n    const { auth } = user;\\r\\n    const idToken = await user.getIdToken();\\r\\n    const request = {\\r\\n        idToken,\\r\\n        returnSecureToken: true\\r\\n    };\\r\\n    if (email) {\\r\\n        request.email = email;\\r\\n    }\\r\\n    if (password) {\\r\\n        request.password = password;\\r\\n    }\\r\\n    const response = await _logoutIfInvalidated(user, updateEmailPassword(auth, request));\\r\\n    await user._updateTokensIfNecessary(response, /* reload */ true);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Parse the `AdditionalUserInfo` from the ID token response.\\r\\n *\\r\\n */\\r\\nfunction _fromIdTokenResponse(idTokenResponse) {\\r\\n    var _a, _b;\\r\\n    if (!idTokenResponse) {\\r\\n        return null;\\r\\n    }\\r\\n    const { providerId } = idTokenResponse;\\r\\n    const profile = idTokenResponse.rawUserInfo\\r\\n        ? JSON.parse(idTokenResponse.rawUserInfo)\\r\\n        : {};\\r\\n    const isNewUser = idTokenResponse.isNewUser ||\\r\\n        idTokenResponse.kind === \\\"identitytoolkit#SignupNewUserResponse\\\" /* SignupNewUser */;\\r\\n    if (!providerId && (idTokenResponse === null || idTokenResponse === void 0 ? void 0 : idTokenResponse.idToken)) {\\r\\n        const signInProvider = (_b = (_a = _parseToken(idTokenResponse.idToken)) === null || _a === void 0 ? void 0 : _a.firebase) === null || _b === void 0 ? void 0 : _b['sign_in_provider'];\\r\\n        if (signInProvider) {\\r\\n            const filteredProviderId = signInProvider !== \\\"anonymous\\\" /* ANONYMOUS */ &&\\r\\n                signInProvider !== \\\"custom\\\" /* CUSTOM */\\r\\n                ? signInProvider\\r\\n                : null;\\r\\n            // Uses generic class in accordance with the legacy SDK.\\r\\n            return new GenericAdditionalUserInfo(isNewUser, filteredProviderId);\\r\\n        }\\r\\n    }\\r\\n    if (!providerId) {\\r\\n        return null;\\r\\n    }\\r\\n    switch (providerId) {\\r\\n        case \\\"facebook.com\\\" /* FACEBOOK */:\\r\\n            return new FacebookAdditionalUserInfo(isNewUser, profile);\\r\\n        case \\\"github.com\\\" /* GITHUB */:\\r\\n            return new GithubAdditionalUserInfo(isNewUser, profile);\\r\\n        case \\\"google.com\\\" /* GOOGLE */:\\r\\n            return new GoogleAdditionalUserInfo(isNewUser, profile);\\r\\n        case \\\"twitter.com\\\" /* TWITTER */:\\r\\n            return new TwitterAdditionalUserInfo(isNewUser, profile, idTokenResponse.screenName || null);\\r\\n        case \\\"custom\\\" /* CUSTOM */:\\r\\n        case \\\"anonymous\\\" /* ANONYMOUS */:\\r\\n            return new GenericAdditionalUserInfo(isNewUser, null);\\r\\n        default:\\r\\n            return new GenericAdditionalUserInfo(isNewUser, providerId, profile);\\r\\n    }\\r\\n}\\r\\nclass GenericAdditionalUserInfo {\\r\\n    constructor(isNewUser, providerId, profile = {}) {\\r\\n        this.isNewUser = isNewUser;\\r\\n        this.providerId = providerId;\\r\\n        this.profile = profile;\\r\\n    }\\r\\n}\\r\\nclass FederatedAdditionalUserInfoWithUsername extends GenericAdditionalUserInfo {\\r\\n    constructor(isNewUser, providerId, profile, username) {\\r\\n        super(isNewUser, providerId, profile);\\r\\n        this.username = username;\\r\\n    }\\r\\n}\\r\\nclass FacebookAdditionalUserInfo extends GenericAdditionalUserInfo {\\r\\n    constructor(isNewUser, profile) {\\r\\n        super(isNewUser, \\\"facebook.com\\\" /* FACEBOOK */, profile);\\r\\n    }\\r\\n}\\r\\nclass GithubAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {\\r\\n    constructor(isNewUser, profile) {\\r\\n        super(isNewUser, \\\"github.com\\\" /* GITHUB */, profile, typeof (profile === null || profile === void 0 ? void 0 : profile.login) === 'string' ? profile === null || profile === void 0 ? void 0 : profile.login : null);\\r\\n    }\\r\\n}\\r\\nclass GoogleAdditionalUserInfo extends GenericAdditionalUserInfo {\\r\\n    constructor(isNewUser, profile) {\\r\\n        super(isNewUser, \\\"google.com\\\" /* GOOGLE */, profile);\\r\\n    }\\r\\n}\\r\\nclass TwitterAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {\\r\\n    constructor(isNewUser, profile, screenName) {\\r\\n        super(isNewUser, \\\"twitter.com\\\" /* TWITTER */, profile, screenName);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Extracts provider specific {@link AdditionalUserInfo} for the given credential.\\r\\n *\\r\\n * @param userCredential - The user credential.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getAdditionalUserInfo(userCredential) {\\r\\n    const { user, _tokenResponse } = userCredential;\\r\\n    if (user.isAnonymous && !_tokenResponse) {\\r\\n        // Handle the special case where signInAnonymously() gets called twice.\\r\\n        // No network call is made so there's nothing to actually fill this in\\r\\n        return {\\r\\n            providerId: null,\\r\\n            isNewUser: false,\\r\\n            profile: null\\r\\n        };\\r\\n    }\\r\\n    return _fromIdTokenResponse(_tokenResponse);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Non-optional auth methods.\\r\\n/**\\r\\n * Changes the type of persistence on the {@link Auth} instance for the currently saved\\r\\n * `Auth` session and applies this type of persistence for future sign-in requests, including\\r\\n * sign-in with redirect requests.\\r\\n *\\r\\n * @remarks\\r\\n * This makes it easy for a user signing in to specify whether their session should be\\r\\n * remembered or not. It also makes it easier to never persist the `Auth` state for applications\\r\\n * that are shared by other users or have sensitive data.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * setPersistence(auth, browserSessionPersistence);\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param persistence - The {@link Persistence} to use.\\r\\n * @returns A `Promise` that resolves once the persistence change has completed\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setPersistence(auth, persistence) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).setPersistence(persistence);\\r\\n}\\r\\n/**\\r\\n * Adds an observer for changes to the signed-in user's ID token, which includes sign-in,\\r\\n * sign-out, and token refresh events.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param nextOrObserver - callback triggered on change.\\r\\n * @param error - callback triggered on error.\\r\\n * @param completed - callback triggered when observer is removed.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onIdTokenChanged(auth, nextOrObserver, error, completed) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).onIdTokenChanged(nextOrObserver, error, completed);\\r\\n}\\r\\n/**\\r\\n * Adds a blocking callback that runs before an auth state change\\r\\n * sets a new user.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param callback - callback triggered before new user value is set.\\r\\n *   If this throws, it blocks the user from being set.\\r\\n * @param onAbort - callback triggered if a later `beforeAuthStateChanged()`\\r\\n *   callback throws, allowing you to undo any side effects.\\r\\n */\\r\\nfunction beforeAuthStateChanged(auth, callback, onAbort) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).beforeAuthStateChanged(callback, onAbort);\\r\\n}\\r\\n/**\\r\\n * Adds an observer for changes to the user's sign-in state.\\r\\n *\\r\\n * @remarks\\r\\n * To keep the old behavior, see {@link onIdTokenChanged}.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param nextOrObserver - callback triggered on change.\\r\\n * @param error - callback triggered on error.\\r\\n * @param completed - callback triggered when observer is removed.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onAuthStateChanged(auth, nextOrObserver, error, completed) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).onAuthStateChanged(nextOrObserver, error, completed);\\r\\n}\\r\\n/**\\r\\n * Sets the current language to the default device/browser preference.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction useDeviceLanguage(auth) {\\r\\n    (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).useDeviceLanguage();\\r\\n}\\r\\n/**\\r\\n * Asynchronously sets the provided user as {@link Auth.currentUser} on the\\r\\n * {@link Auth} instance.\\r\\n *\\r\\n * @remarks\\r\\n * A new instance copy of the user provided will be made and set as currentUser.\\r\\n *\\r\\n * This will trigger {@link onAuthStateChanged} and {@link onIdTokenChanged} listeners\\r\\n * like other sign in methods.\\r\\n *\\r\\n * The operation fails with an error if the user to be updated belongs to a different Firebase\\r\\n * project.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param user - The new {@link User}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction updateCurrentUser(auth, user) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).updateCurrentUser(user);\\r\\n}\\r\\n/**\\r\\n * Signs out the current user.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction signOut(auth) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth).signOut();\\r\\n}\\r\\n/**\\r\\n * Deletes and signs out the user.\\r\\n *\\r\\n * @remarks\\r\\n * Important: this is a security-sensitive operation that requires the user to have recently\\r\\n * signed in. If this requirement isn't met, ask the user to authenticate again and then call\\r\\n * {@link reauthenticateWithCredential}.\\r\\n *\\r\\n * @param user - The user.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteUser(user) {\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user).delete();\\r\\n}\\n\\nclass MultiFactorSessionImpl {\\r\\n    constructor(type, credential) {\\r\\n        this.type = type;\\r\\n        this.credential = credential;\\r\\n    }\\r\\n    static _fromIdtoken(idToken) {\\r\\n        return new MultiFactorSessionImpl(\\\"enroll\\\" /* ENROLL */, idToken);\\r\\n    }\\r\\n    static _fromMfaPendingCredential(mfaPendingCredential) {\\r\\n        return new MultiFactorSessionImpl(\\\"signin\\\" /* SIGN_IN */, mfaPendingCredential);\\r\\n    }\\r\\n    toJSON() {\\r\\n        const key = this.type === \\\"enroll\\\" /* ENROLL */\\r\\n            ? 'idToken'\\r\\n            : 'pendingCredential';\\r\\n        return {\\r\\n            multiFactorSession: {\\r\\n                [key]: this.credential\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n    static fromJSON(obj) {\\r\\n        var _a, _b;\\r\\n        if (obj === null || obj === void 0 ? void 0 : obj.multiFactorSession) {\\r\\n            if ((_a = obj.multiFactorSession) === null || _a === void 0 ? void 0 : _a.pendingCredential) {\\r\\n                return MultiFactorSessionImpl._fromMfaPendingCredential(obj.multiFactorSession.pendingCredential);\\r\\n            }\\r\\n            else if ((_b = obj.multiFactorSession) === null || _b === void 0 ? void 0 : _b.idToken) {\\r\\n                return MultiFactorSessionImpl._fromIdtoken(obj.multiFactorSession.idToken);\\r\\n            }\\r\\n        }\\r\\n        return null;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass MultiFactorResolverImpl {\\r\\n    constructor(session, hints, signInResolver) {\\r\\n        this.session = session;\\r\\n        this.hints = hints;\\r\\n        this.signInResolver = signInResolver;\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromError(authExtern, error) {\\r\\n        const auth = _castAuth(authExtern);\\r\\n        const serverResponse = error.customData._serverResponse;\\r\\n        const hints = (serverResponse.mfaInfo || []).map(enrollment => MultiFactorInfoImpl._fromServerResponse(auth, enrollment));\\r\\n        _assert(serverResponse.mfaPendingCredential, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        const session = MultiFactorSessionImpl._fromMfaPendingCredential(serverResponse.mfaPendingCredential);\\r\\n        return new MultiFactorResolverImpl(session, hints, async (assertion) => {\\r\\n            const mfaResponse = await assertion._process(auth, session);\\r\\n            // Clear out the unneeded fields from the old login response\\r\\n            delete serverResponse.mfaInfo;\\r\\n            delete serverResponse.mfaPendingCredential;\\r\\n            // Use in the new token & refresh token in the old response\\r\\n            const idTokenResponse = Object.assign(Object.assign({}, serverResponse), { idToken: mfaResponse.idToken, refreshToken: mfaResponse.refreshToken });\\r\\n            // TODO: we should collapse this switch statement into UserCredentialImpl._forOperation and have it support the SIGN_IN case\\r\\n            switch (error.operationType) {\\r\\n                case \\\"signIn\\\" /* SIGN_IN */:\\r\\n                    const userCredential = await UserCredentialImpl._fromIdTokenResponse(auth, error.operationType, idTokenResponse);\\r\\n                    await auth._updateCurrentUser(userCredential.user);\\r\\n                    return userCredential;\\r\\n                case \\\"reauthenticate\\\" /* REAUTHENTICATE */:\\r\\n                    _assert(error.user, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n                    return UserCredentialImpl._forOperation(error.user, error.operationType, idTokenResponse);\\r\\n                default:\\r\\n                    _fail(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    async resolveSignIn(assertionExtern) {\\r\\n        const assertion = assertionExtern;\\r\\n        return this.signInResolver(assertion);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Provides a {@link MultiFactorResolver} suitable for completion of a\\r\\n * multi-factor flow.\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param error - The {@link MultiFactorError} raised during a sign-in, or\\r\\n * reauthentication operation.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getMultiFactorResolver(auth, error) {\\r\\n    var _a;\\r\\n    const authModular = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(auth);\\r\\n    const errorInternal = error;\\r\\n    _assert(error.customData.operationType, authModular, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n    _assert((_a = errorInternal.customData._serverResponse) === null || _a === void 0 ? void 0 : _a.mfaPendingCredential, authModular, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n    return MultiFactorResolverImpl._fromError(authModular, errorInternal);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction startEnrollPhoneMfa(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v2/accounts/mfaEnrollment:start\\\" /* START_PHONE_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nfunction finalizeEnrollPhoneMfa(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v2/accounts/mfaEnrollment:finalize\\\" /* FINALIZE_PHONE_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nfunction withdrawMfa(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v2/accounts/mfaEnrollment:withdraw\\\" /* WITHDRAW_MFA */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\nclass MultiFactorUserImpl {\\r\\n    constructor(user) {\\r\\n        this.user = user;\\r\\n        this.enrolledFactors = [];\\r\\n        user._onReload(userInfo => {\\r\\n            if (userInfo.mfaInfo) {\\r\\n                this.enrolledFactors = userInfo.mfaInfo.map(enrollment => MultiFactorInfoImpl._fromServerResponse(user.auth, enrollment));\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    static _fromUser(user) {\\r\\n        return new MultiFactorUserImpl(user);\\r\\n    }\\r\\n    async getSession() {\\r\\n        return MultiFactorSessionImpl._fromIdtoken(await this.user.getIdToken());\\r\\n    }\\r\\n    async enroll(assertionExtern, displayName) {\\r\\n        const assertion = assertionExtern;\\r\\n        const session = (await this.getSession());\\r\\n        const finalizeMfaResponse = await _logoutIfInvalidated(this.user, assertion._process(this.user.auth, session, displayName));\\r\\n        // New tokens will be issued after enrollment of the new second factors.\\r\\n        // They need to be updated on the user.\\r\\n        await this.user._updateTokensIfNecessary(finalizeMfaResponse);\\r\\n        // The user needs to be reloaded to get the new multi-factor information\\r\\n        // from server. USER_RELOADED event will be triggered and `enrolledFactors`\\r\\n        // will be updated.\\r\\n        return this.user.reload();\\r\\n    }\\r\\n    async unenroll(infoOrUid) {\\r\\n        const mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;\\r\\n        const idToken = await this.user.getIdToken();\\r\\n        const idTokenResponse = await _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {\\r\\n            idToken,\\r\\n            mfaEnrollmentId\\r\\n        }));\\r\\n        // Remove the second factor from the user's list.\\r\\n        this.enrolledFactors = this.enrolledFactors.filter(({ uid }) => uid !== mfaEnrollmentId);\\r\\n        // Depending on whether the backend decided to revoke the user's session,\\r\\n        // the tokenResponse may be empty. If the tokens were not updated (and they\\r\\n        // are now invalid), reloading the user will discover this and invalidate\\r\\n        // the user's state accordingly.\\r\\n        await this.user._updateTokensIfNecessary(idTokenResponse);\\r\\n        try {\\r\\n            await this.user.reload();\\r\\n        }\\r\\n        catch (e) {\\r\\n            if (e.code !== `auth/${\\\"user-token-expired\\\" /* TOKEN_EXPIRED */}`) {\\r\\n                throw e;\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n}\\r\\nconst multiFactorUserCache = new WeakMap();\\r\\n/**\\r\\n * The {@link MultiFactorUser} corresponding to the user.\\r\\n *\\r\\n * @remarks\\r\\n * This is used to access all multi-factor properties and operations related to the user.\\r\\n *\\r\\n * @param user - The user.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction multiFactor(user) {\\r\\n    const userModular = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    if (!multiFactorUserCache.has(userModular)) {\\r\\n        multiFactorUserCache.set(userModular, MultiFactorUserImpl._fromUser(userModular));\\r\\n    }\\r\\n    return multiFactorUserCache.get(userModular);\\r\\n}\\n\\nconst STORAGE_AVAILABLE_KEY = '__sak';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// There are two different browser persistence types: local and session.\\r\\n// Both have the same implementation but use a different underlying storage\\r\\n// object.\\r\\nclass BrowserPersistenceClass {\\r\\n    constructor(storageRetriever, type) {\\r\\n        this.storageRetriever = storageRetriever;\\r\\n        this.type = type;\\r\\n    }\\r\\n    _isAvailable() {\\r\\n        try {\\r\\n            if (!this.storage) {\\r\\n                return Promise.resolve(false);\\r\\n            }\\r\\n            this.storage.setItem(STORAGE_AVAILABLE_KEY, '1');\\r\\n            this.storage.removeItem(STORAGE_AVAILABLE_KEY);\\r\\n            return Promise.resolve(true);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            return Promise.resolve(false);\\r\\n        }\\r\\n    }\\r\\n    _set(key, value) {\\r\\n        this.storage.setItem(key, JSON.stringify(value));\\r\\n        return Promise.resolve();\\r\\n    }\\r\\n    _get(key) {\\r\\n        const json = this.storage.getItem(key);\\r\\n        return Promise.resolve(json ? JSON.parse(json) : null);\\r\\n    }\\r\\n    _remove(key) {\\r\\n        this.storage.removeItem(key);\\r\\n        return Promise.resolve();\\r\\n    }\\r\\n    get storage() {\\r\\n        return this.storageRetriever();\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _iframeCannotSyncWebStorage() {\\r\\n    const ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)();\\r\\n    return _isSafari(ua) || _isIOS(ua);\\r\\n}\\r\\n// The polling period in case events are not supported\\r\\nconst _POLLING_INTERVAL_MS$1 = 1000;\\r\\n// The IE 10 localStorage cross tab synchronization delay in milliseconds\\r\\nconst IE10_LOCAL_STORAGE_SYNC_DELAY = 10;\\r\\nclass BrowserLocalPersistence extends BrowserPersistenceClass {\\r\\n    constructor() {\\r\\n        super(() => window.localStorage, \\\"LOCAL\\\" /* LOCAL */);\\r\\n        this.boundEventHandler = (event, poll) => this.onStorageEvent(event, poll);\\r\\n        this.listeners = {};\\r\\n        this.localCache = {};\\r\\n        // setTimeout return value is platform specific\\r\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n        this.pollTimer = null;\\r\\n        // Safari or iOS browser and embedded in an iframe.\\r\\n        this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() && _isIframe();\\r\\n        // Whether to use polling instead of depending on window events\\r\\n        this.fallbackToPolling = _isMobileBrowser();\\r\\n        this._shouldAllowMigration = true;\\r\\n    }\\r\\n    forAllChangedKeys(cb) {\\r\\n        // Check all keys with listeners on them.\\r\\n        for (const key of Object.keys(this.listeners)) {\\r\\n            // Get value from localStorage.\\r\\n            const newValue = this.storage.getItem(key);\\r\\n            const oldValue = this.localCache[key];\\r\\n            // If local map value does not match, trigger listener with storage event.\\r\\n            // Differentiate this simulated event from the real storage event.\\r\\n            if (newValue !== oldValue) {\\r\\n                cb(key, oldValue, newValue);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    onStorageEvent(event, poll = false) {\\r\\n        // Key would be null in some situations, like when localStorage is cleared\\r\\n        if (!event.key) {\\r\\n            this.forAllChangedKeys((key, _oldValue, newValue) => {\\r\\n                this.notifyListeners(key, newValue);\\r\\n            });\\r\\n            return;\\r\\n        }\\r\\n        const key = event.key;\\r\\n        // Check the mechanism how this event was detected.\\r\\n        // The first event will dictate the mechanism to be used.\\r\\n        if (poll) {\\r\\n            // Environment detects storage changes via polling.\\r\\n            // Remove storage event listener to prevent possible event duplication.\\r\\n            this.detachListener();\\r\\n        }\\r\\n        else {\\r\\n            // Environment detects storage changes via storage event listener.\\r\\n            // Remove polling listener to prevent possible event duplication.\\r\\n            this.stopPolling();\\r\\n        }\\r\\n        // Safari embedded iframe. Storage event will trigger with the delta\\r\\n        // changes but no changes will be applied to the iframe localStorage.\\r\\n        if (this.safariLocalStorageNotSynced) {\\r\\n            // Get current iframe page value.\\r\\n            const storedValue = this.storage.getItem(key);\\r\\n            // Value not synchronized, synchronize manually.\\r\\n            if (event.newValue !== storedValue) {\\r\\n                if (event.newValue !== null) {\\r\\n                    // Value changed from current value.\\r\\n                    this.storage.setItem(key, event.newValue);\\r\\n                }\\r\\n                else {\\r\\n                    // Current value deleted.\\r\\n                    this.storage.removeItem(key);\\r\\n                }\\r\\n            }\\r\\n            else if (this.localCache[key] === event.newValue && !poll) {\\r\\n                // Already detected and processed, do not trigger listeners again.\\r\\n                return;\\r\\n            }\\r\\n        }\\r\\n        const triggerListeners = () => {\\r\\n            // Keep local map up to date in case storage event is triggered before\\r\\n            // poll.\\r\\n            const storedValue = this.storage.getItem(key);\\r\\n            if (!poll && this.localCache[key] === storedValue) {\\r\\n                // Real storage event which has already been detected, do nothing.\\r\\n                // This seems to trigger in some IE browsers for some reason.\\r\\n                return;\\r\\n            }\\r\\n            this.notifyListeners(key, storedValue);\\r\\n        };\\r\\n        const storedValue = this.storage.getItem(key);\\r\\n        if (_isIE10() &&\\r\\n            storedValue !== event.newValue &&\\r\\n            event.newValue !== event.oldValue) {\\r\\n            // IE 10 has this weird bug where a storage event would trigger with the\\r\\n            // correct key, oldValue and newValue but localStorage.getItem(key) does\\r\\n            // not yield the updated value until a few milliseconds. This ensures\\r\\n            // this recovers from that situation.\\r\\n            setTimeout(triggerListeners, IE10_LOCAL_STORAGE_SYNC_DELAY);\\r\\n        }\\r\\n        else {\\r\\n            triggerListeners();\\r\\n        }\\r\\n    }\\r\\n    notifyListeners(key, value) {\\r\\n        this.localCache[key] = value;\\r\\n        const listeners = this.listeners[key];\\r\\n        if (listeners) {\\r\\n            for (const listener of Array.from(listeners)) {\\r\\n                listener(value ? JSON.parse(value) : value);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    startPolling() {\\r\\n        this.stopPolling();\\r\\n        this.pollTimer = setInterval(() => {\\r\\n            this.forAllChangedKeys((key, oldValue, newValue) => {\\r\\n                this.onStorageEvent(new StorageEvent('storage', {\\r\\n                    key,\\r\\n                    oldValue,\\r\\n                    newValue\\r\\n                }), \\r\\n                /* poll */ true);\\r\\n            });\\r\\n        }, _POLLING_INTERVAL_MS$1);\\r\\n    }\\r\\n    stopPolling() {\\r\\n        if (this.pollTimer) {\\r\\n            clearInterval(this.pollTimer);\\r\\n            this.pollTimer = null;\\r\\n        }\\r\\n    }\\r\\n    attachListener() {\\r\\n        window.addEventListener('storage', this.boundEventHandler);\\r\\n    }\\r\\n    detachListener() {\\r\\n        window.removeEventListener('storage', this.boundEventHandler);\\r\\n    }\\r\\n    _addListener(key, listener) {\\r\\n        if (Object.keys(this.listeners).length === 0) {\\r\\n            // Whether browser can detect storage event when it had already been pushed to the background.\\r\\n            // This may happen in some mobile browsers. A localStorage change in the foreground window\\r\\n            // will not be detected in the background window via the storage event.\\r\\n            // This was detected in iOS 7.x mobile browsers\\r\\n            if (this.fallbackToPolling) {\\r\\n                this.startPolling();\\r\\n            }\\r\\n            else {\\r\\n                this.attachListener();\\r\\n            }\\r\\n        }\\r\\n        if (!this.listeners[key]) {\\r\\n            this.listeners[key] = new Set();\\r\\n            // Populate the cache to avoid spuriously triggering on first poll.\\r\\n            this.localCache[key] = this.storage.getItem(key);\\r\\n        }\\r\\n        this.listeners[key].add(listener);\\r\\n    }\\r\\n    _removeListener(key, listener) {\\r\\n        if (this.listeners[key]) {\\r\\n            this.listeners[key].delete(listener);\\r\\n            if (this.listeners[key].size === 0) {\\r\\n                delete this.listeners[key];\\r\\n            }\\r\\n        }\\r\\n        if (Object.keys(this.listeners).length === 0) {\\r\\n            this.detachListener();\\r\\n            this.stopPolling();\\r\\n        }\\r\\n    }\\r\\n    // Update local cache on base operations:\\r\\n    async _set(key, value) {\\r\\n        await super._set(key, value);\\r\\n        this.localCache[key] = JSON.stringify(value);\\r\\n    }\\r\\n    async _get(key) {\\r\\n        const value = await super._get(key);\\r\\n        this.localCache[key] = JSON.stringify(value);\\r\\n        return value;\\r\\n    }\\r\\n    async _remove(key) {\\r\\n        await super._remove(key);\\r\\n        delete this.localCache[key];\\r\\n    }\\r\\n}\\r\\nBrowserLocalPersistence.type = 'LOCAL';\\r\\n/**\\r\\n * An implementation of {@link Persistence} of type `LOCAL` using `localStorage`\\r\\n * for the underlying storage.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst browserLocalPersistence = BrowserLocalPersistence;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass BrowserSessionPersistence extends BrowserPersistenceClass {\\r\\n    constructor() {\\r\\n        super(() => window.sessionStorage, \\\"SESSION\\\" /* SESSION */);\\r\\n    }\\r\\n    _addListener(_key, _listener) {\\r\\n        // Listeners are not supported for session storage since it cannot be shared across windows\\r\\n        return;\\r\\n    }\\r\\n    _removeListener(_key, _listener) {\\r\\n        // Listeners are not supported for session storage since it cannot be shared across windows\\r\\n        return;\\r\\n    }\\r\\n}\\r\\nBrowserSessionPersistence.type = 'SESSION';\\r\\n/**\\r\\n * An implementation of {@link Persistence} of `SESSION` using `sessionStorage`\\r\\n * for the underlying storage.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst browserSessionPersistence = BrowserSessionPersistence;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Shim for Promise.allSettled, note the slightly different format of `fulfilled` vs `status`.\\r\\n *\\r\\n * @param promises - Array of promises to wait on.\\r\\n */\\r\\nfunction _allSettled(promises) {\\r\\n    return Promise.all(promises.map(async (promise) => {\\r\\n        try {\\r\\n            const value = await promise;\\r\\n            return {\\r\\n                fulfilled: true,\\r\\n                value\\r\\n            };\\r\\n        }\\r\\n        catch (reason) {\\r\\n            return {\\r\\n                fulfilled: false,\\r\\n                reason\\r\\n            };\\r\\n        }\\r\\n    }));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Interface class for receiving messages.\\r\\n *\\r\\n */\\r\\nclass Receiver {\\r\\n    constructor(eventTarget) {\\r\\n        this.eventTarget = eventTarget;\\r\\n        this.handlersMap = {};\\r\\n        this.boundEventHandler = this.handleEvent.bind(this);\\r\\n    }\\r\\n    /**\\r\\n     * Obtain an instance of a Receiver for a given event target, if none exists it will be created.\\r\\n     *\\r\\n     * @param eventTarget - An event target (such as window or self) through which the underlying\\r\\n     * messages will be received.\\r\\n     */\\r\\n    static _getInstance(eventTarget) {\\r\\n        // The results are stored in an array since objects can't be keys for other\\r\\n        // objects. In addition, setting a unique property on an event target as a\\r\\n        // hash map key may not be allowed due to CORS restrictions.\\r\\n        const existingInstance = this.receivers.find(receiver => receiver.isListeningto(eventTarget));\\r\\n        if (existingInstance) {\\r\\n            return existingInstance;\\r\\n        }\\r\\n        const newInstance = new Receiver(eventTarget);\\r\\n        this.receivers.push(newInstance);\\r\\n        return newInstance;\\r\\n    }\\r\\n    isListeningto(eventTarget) {\\r\\n        return this.eventTarget === eventTarget;\\r\\n    }\\r\\n    /**\\r\\n     * Fans out a MessageEvent to the appropriate listeners.\\r\\n     *\\r\\n     * @remarks\\r\\n     * Sends an {@link Status.ACK} upon receipt and a {@link Status.DONE} once all handlers have\\r\\n     * finished processing.\\r\\n     *\\r\\n     * @param event - The MessageEvent.\\r\\n     *\\r\\n     */\\r\\n    async handleEvent(event) {\\r\\n        const messageEvent = event;\\r\\n        const { eventId, eventType, data } = messageEvent.data;\\r\\n        const handlers = this.handlersMap[eventType];\\r\\n        if (!(handlers === null || handlers === void 0 ? void 0 : handlers.size)) {\\r\\n            return;\\r\\n        }\\r\\n        messageEvent.ports[0].postMessage({\\r\\n            status: \\\"ack\\\" /* ACK */,\\r\\n            eventId,\\r\\n            eventType\\r\\n        });\\r\\n        const promises = Array.from(handlers).map(async (handler) => handler(messageEvent.origin, data));\\r\\n        const response = await _allSettled(promises);\\r\\n        messageEvent.ports[0].postMessage({\\r\\n            status: \\\"done\\\" /* DONE */,\\r\\n            eventId,\\r\\n            eventType,\\r\\n            response\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe an event handler for a particular event.\\r\\n     *\\r\\n     * @param eventType - Event name to subscribe to.\\r\\n     * @param eventHandler - The event handler which should receive the events.\\r\\n     *\\r\\n     */\\r\\n    _subscribe(eventType, eventHandler) {\\r\\n        if (Object.keys(this.handlersMap).length === 0) {\\r\\n            this.eventTarget.addEventListener('message', this.boundEventHandler);\\r\\n        }\\r\\n        if (!this.handlersMap[eventType]) {\\r\\n            this.handlersMap[eventType] = new Set();\\r\\n        }\\r\\n        this.handlersMap[eventType].add(eventHandler);\\r\\n    }\\r\\n    /**\\r\\n     * Unsubscribe an event handler from a particular event.\\r\\n     *\\r\\n     * @param eventType - Event name to unsubscribe from.\\r\\n     * @param eventHandler - Optinoal event handler, if none provided, unsubscribe all handlers on this event.\\r\\n     *\\r\\n     */\\r\\n    _unsubscribe(eventType, eventHandler) {\\r\\n        if (this.handlersMap[eventType] && eventHandler) {\\r\\n            this.handlersMap[eventType].delete(eventHandler);\\r\\n        }\\r\\n        if (!eventHandler || this.handlersMap[eventType].size === 0) {\\r\\n            delete this.handlersMap[eventType];\\r\\n        }\\r\\n        if (Object.keys(this.handlersMap).length === 0) {\\r\\n            this.eventTarget.removeEventListener('message', this.boundEventHandler);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nReceiver.receivers = [];\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _generateEventId(prefix = '', digits = 10) {\\r\\n    let random = '';\\r\\n    for (let i = 0; i < digits; i++) {\\r\\n        random += Math.floor(Math.random() * 10);\\r\\n    }\\r\\n    return prefix + random;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Interface for sending messages and waiting for a completion response.\\r\\n *\\r\\n */\\r\\nclass Sender {\\r\\n    constructor(target) {\\r\\n        this.target = target;\\r\\n        this.handlers = new Set();\\r\\n    }\\r\\n    /**\\r\\n     * Unsubscribe the handler and remove it from our tracking Set.\\r\\n     *\\r\\n     * @param handler - The handler to unsubscribe.\\r\\n     */\\r\\n    removeMessageHandler(handler) {\\r\\n        if (handler.messageChannel) {\\r\\n            handler.messageChannel.port1.removeEventListener('message', handler.onMessage);\\r\\n            handler.messageChannel.port1.close();\\r\\n        }\\r\\n        this.handlers.delete(handler);\\r\\n    }\\r\\n    /**\\r\\n     * Send a message to the Receiver located at {@link target}.\\r\\n     *\\r\\n     * @remarks\\r\\n     * We'll first wait a bit for an ACK , if we get one we will wait significantly longer until the\\r\\n     * receiver has had a chance to fully process the event.\\r\\n     *\\r\\n     * @param eventType - Type of event to send.\\r\\n     * @param data - The payload of the event.\\r\\n     * @param timeout - Timeout for waiting on an ACK from the receiver.\\r\\n     *\\r\\n     * @returns An array of settled promises from all the handlers that were listening on the receiver.\\r\\n     */\\r\\n    async _send(eventType, data, timeout = 50 /* ACK */) {\\r\\n        const messageChannel = typeof MessageChannel !== 'undefined' ? new MessageChannel() : null;\\r\\n        if (!messageChannel) {\\r\\n            throw new Error(\\\"connection_unavailable\\\" /* CONNECTION_UNAVAILABLE */);\\r\\n        }\\r\\n        // Node timers and browser timers return fundamentally different types.\\r\\n        // We don't actually care what the value is but TS won't accept unknown and\\r\\n        // we can't cast properly in both environments.\\r\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n        let completionTimer;\\r\\n        let handler;\\r\\n        return new Promise((resolve, reject) => {\\r\\n            const eventId = _generateEventId('', 20);\\r\\n            messageChannel.port1.start();\\r\\n            const ackTimer = setTimeout(() => {\\r\\n                reject(new Error(\\\"unsupported_event\\\" /* UNSUPPORTED_EVENT */));\\r\\n            }, timeout);\\r\\n            handler = {\\r\\n                messageChannel,\\r\\n                onMessage(event) {\\r\\n                    const messageEvent = event;\\r\\n                    if (messageEvent.data.eventId !== eventId) {\\r\\n                        return;\\r\\n                    }\\r\\n                    switch (messageEvent.data.status) {\\r\\n                        case \\\"ack\\\" /* ACK */:\\r\\n                            // The receiver should ACK first.\\r\\n                            clearTimeout(ackTimer);\\r\\n                            completionTimer = setTimeout(() => {\\r\\n                                reject(new Error(\\\"timeout\\\" /* TIMEOUT */));\\r\\n                            }, 3000 /* COMPLETION */);\\r\\n                            break;\\r\\n                        case \\\"done\\\" /* DONE */:\\r\\n                            // Once the receiver's handlers are finished we will get the results.\\r\\n                            clearTimeout(completionTimer);\\r\\n                            resolve(messageEvent.data.response);\\r\\n                            break;\\r\\n                        default:\\r\\n                            clearTimeout(ackTimer);\\r\\n                            clearTimeout(completionTimer);\\r\\n                            reject(new Error(\\\"invalid_response\\\" /* INVALID_RESPONSE */));\\r\\n                            break;\\r\\n                    }\\r\\n                }\\r\\n            };\\r\\n            this.handlers.add(handler);\\r\\n            messageChannel.port1.addEventListener('message', handler.onMessage);\\r\\n            this.target.postMessage({\\r\\n                eventType,\\r\\n                eventId,\\r\\n                data\\r\\n            }, [messageChannel.port2]);\\r\\n        }).finally(() => {\\r\\n            if (handler) {\\r\\n                this.removeMessageHandler(handler);\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Lazy accessor for window, since the compat layer won't tree shake this out,\\r\\n * we need to make sure not to mess with window unless we have to\\r\\n */\\r\\nfunction _window() {\\r\\n    return window;\\r\\n}\\r\\nfunction _setWindowLocation(url) {\\r\\n    _window().location.href = url;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC.\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction _isWorker() {\\r\\n    return (typeof _window()['WorkerGlobalScope'] !== 'undefined' &&\\r\\n        typeof _window()['importScripts'] === 'function');\\r\\n}\\r\\nasync function _getActiveServiceWorker() {\\r\\n    if (!(navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker)) {\\r\\n        return null;\\r\\n    }\\r\\n    try {\\r\\n        const registration = await navigator.serviceWorker.ready;\\r\\n        return registration.active;\\r\\n    }\\r\\n    catch (_a) {\\r\\n        return null;\\r\\n    }\\r\\n}\\r\\nfunction _getServiceWorkerController() {\\r\\n    var _a;\\r\\n    return ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker) === null || _a === void 0 ? void 0 : _a.controller) || null;\\r\\n}\\r\\nfunction _getWorkerGlobalScope() {\\r\\n    return _isWorker() ? self : null;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebaseLocalStorageDb';\\r\\nconst DB_VERSION = 1;\\r\\nconst DB_OBJECTSTORE_NAME = 'firebaseLocalStorage';\\r\\nconst DB_DATA_KEYPATH = 'fbase_key';\\r\\n/**\\r\\n * Promise wrapper for IDBRequest\\r\\n *\\r\\n * Unfortunately we can't cleanly extend Promise<T> since promises are not callable in ES6\\r\\n *\\r\\n */\\r\\nclass DBPromise {\\r\\n    constructor(request) {\\r\\n        this.request = request;\\r\\n    }\\r\\n    toPromise() {\\r\\n        return new Promise((resolve, reject) => {\\r\\n            this.request.addEventListener('success', () => {\\r\\n                resolve(this.request.result);\\r\\n            });\\r\\n            this.request.addEventListener('error', () => {\\r\\n                reject(this.request.error);\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction getObjectStore(db, isReadWrite) {\\r\\n    return db\\r\\n        .transaction([DB_OBJECTSTORE_NAME], isReadWrite ? 'readwrite' : 'readonly')\\r\\n        .objectStore(DB_OBJECTSTORE_NAME);\\r\\n}\\r\\nfunction _deleteDatabase() {\\r\\n    const request = indexedDB.deleteDatabase(DB_NAME);\\r\\n    return new DBPromise(request).toPromise();\\r\\n}\\r\\nfunction _openDatabase() {\\r\\n    const request = indexedDB.open(DB_NAME, DB_VERSION);\\r\\n    return new Promise((resolve, reject) => {\\r\\n        request.addEventListener('error', () => {\\r\\n            reject(request.error);\\r\\n        });\\r\\n        request.addEventListener('upgradeneeded', () => {\\r\\n            const db = request.result;\\r\\n            try {\\r\\n                db.createObjectStore(DB_OBJECTSTORE_NAME, { keyPath: DB_DATA_KEYPATH });\\r\\n            }\\r\\n            catch (e) {\\r\\n                reject(e);\\r\\n            }\\r\\n        });\\r\\n        request.addEventListener('success', async () => {\\r\\n            const db = request.result;\\r\\n            // Strange bug that occurs in Firefox when multiple tabs are opened at the\\r\\n            // same time. The only way to recover seems to be deleting the database\\r\\n            // and re-initializing it.\\r\\n            // https://github.com/firebase/firebase-js-sdk/issues/634\\r\\n            if (!db.objectStoreNames.contains(DB_OBJECTSTORE_NAME)) {\\r\\n                // Need to close the database or else you get a `blocked` event\\r\\n                db.close();\\r\\n                await _deleteDatabase();\\r\\n                resolve(await _openDatabase());\\r\\n            }\\r\\n            else {\\r\\n                resolve(db);\\r\\n            }\\r\\n        });\\r\\n    });\\r\\n}\\r\\nasync function _putObject(db, key, value) {\\r\\n    const request = getObjectStore(db, true).put({\\r\\n        [DB_DATA_KEYPATH]: key,\\r\\n        value\\r\\n    });\\r\\n    return new DBPromise(request).toPromise();\\r\\n}\\r\\nasync function getObject(db, key) {\\r\\n    const request = getObjectStore(db, false).get(key);\\r\\n    const data = await new DBPromise(request).toPromise();\\r\\n    return data === undefined ? null : data.value;\\r\\n}\\r\\nfunction _deleteObject(db, key) {\\r\\n    const request = getObjectStore(db, true).delete(key);\\r\\n    return new DBPromise(request).toPromise();\\r\\n}\\r\\nconst _POLLING_INTERVAL_MS = 800;\\r\\nconst _TRANSACTION_RETRY_COUNT = 3;\\r\\nclass IndexedDBLocalPersistence {\\r\\n    constructor() {\\r\\n        this.type = \\\"LOCAL\\\" /* LOCAL */;\\r\\n        this._shouldAllowMigration = true;\\r\\n        this.listeners = {};\\r\\n        this.localCache = {};\\r\\n        // setTimeout return value is platform specific\\r\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n        this.pollTimer = null;\\r\\n        this.pendingWrites = 0;\\r\\n        this.receiver = null;\\r\\n        this.sender = null;\\r\\n        this.serviceWorkerReceiverAvailable = false;\\r\\n        this.activeServiceWorker = null;\\r\\n        // Fire & forget the service worker registration as it may never resolve\\r\\n        this._workerInitializationPromise =\\r\\n            this.initializeServiceWorkerMessaging().then(() => { }, () => { });\\r\\n    }\\r\\n    async _openDb() {\\r\\n        if (this.db) {\\r\\n            return this.db;\\r\\n        }\\r\\n        this.db = await _openDatabase();\\r\\n        return this.db;\\r\\n    }\\r\\n    async _withRetries(op) {\\r\\n        let numAttempts = 0;\\r\\n        while (true) {\\r\\n            try {\\r\\n                const db = await this._openDb();\\r\\n                return await op(db);\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {\\r\\n                    throw e;\\r\\n                }\\r\\n                if (this.db) {\\r\\n                    this.db.close();\\r\\n                    this.db = undefined;\\r\\n                }\\r\\n                // TODO: consider adding exponential backoff\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * IndexedDB events do not propagate from the main window to the worker context.  We rely on a\\r\\n     * postMessage interface to send these events to the worker ourselves.\\r\\n     */\\r\\n    async initializeServiceWorkerMessaging() {\\r\\n        return _isWorker() ? this.initializeReceiver() : this.initializeSender();\\r\\n    }\\r\\n    /**\\r\\n     * As the worker we should listen to events from the main window.\\r\\n     */\\r\\n    async initializeReceiver() {\\r\\n        this.receiver = Receiver._getInstance(_getWorkerGlobalScope());\\r\\n        // Refresh from persistence if we receive a KeyChanged message.\\r\\n        this.receiver._subscribe(\\\"keyChanged\\\" /* KEY_CHANGED */, async (_origin, data) => {\\r\\n            const keys = await this._poll();\\r\\n            return {\\r\\n                keyProcessed: keys.includes(data.key)\\r\\n            };\\r\\n        });\\r\\n        // Let the sender know that we are listening so they give us more timeout.\\r\\n        this.receiver._subscribe(\\\"ping\\\" /* PING */, async (_origin, _data) => {\\r\\n            return [\\\"keyChanged\\\" /* KEY_CHANGED */];\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * As the main window, we should let the worker know when keys change (set and remove).\\r\\n     *\\r\\n     * @remarks\\r\\n     * {@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready | ServiceWorkerContainer.ready}\\r\\n     * may not resolve.\\r\\n     */\\r\\n    async initializeSender() {\\r\\n        var _a, _b;\\r\\n        // Check to see if there's an active service worker.\\r\\n        this.activeServiceWorker = await _getActiveServiceWorker();\\r\\n        if (!this.activeServiceWorker) {\\r\\n            return;\\r\\n        }\\r\\n        this.sender = new Sender(this.activeServiceWorker);\\r\\n        // Ping the service worker to check what events they can handle.\\r\\n        const results = await this.sender._send(\\\"ping\\\" /* PING */, {}, 800 /* LONG_ACK */);\\r\\n        if (!results) {\\r\\n            return;\\r\\n        }\\r\\n        if (((_a = results[0]) === null || _a === void 0 ? void 0 : _a.fulfilled) &&\\r\\n            ((_b = results[0]) === null || _b === void 0 ? void 0 : _b.value.includes(\\\"keyChanged\\\" /* KEY_CHANGED */))) {\\r\\n            this.serviceWorkerReceiverAvailable = true;\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Let the worker know about a changed key, the exact key doesn't technically matter since the\\r\\n     * worker will just trigger a full sync anyway.\\r\\n     *\\r\\n     * @remarks\\r\\n     * For now, we only support one service worker per page.\\r\\n     *\\r\\n     * @param key - Storage key which changed.\\r\\n     */\\r\\n    async notifyServiceWorker(key) {\\r\\n        if (!this.sender ||\\r\\n            !this.activeServiceWorker ||\\r\\n            _getServiceWorkerController() !== this.activeServiceWorker) {\\r\\n            return;\\r\\n        }\\r\\n        try {\\r\\n            await this.sender._send(\\\"keyChanged\\\" /* KEY_CHANGED */, { key }, \\r\\n            // Use long timeout if receiver has previously responded to a ping from us.\\r\\n            this.serviceWorkerReceiverAvailable\\r\\n                ? 800 /* LONG_ACK */\\r\\n                : 50 /* ACK */);\\r\\n        }\\r\\n        catch (_a) {\\r\\n            // This is a best effort approach. Ignore errors.\\r\\n        }\\r\\n    }\\r\\n    async _isAvailable() {\\r\\n        try {\\r\\n            if (!indexedDB) {\\r\\n                return false;\\r\\n            }\\r\\n            const db = await _openDatabase();\\r\\n            await _putObject(db, STORAGE_AVAILABLE_KEY, '1');\\r\\n            await _deleteObject(db, STORAGE_AVAILABLE_KEY);\\r\\n            return true;\\r\\n        }\\r\\n        catch (_a) { }\\r\\n        return false;\\r\\n    }\\r\\n    async _withPendingWrite(write) {\\r\\n        this.pendingWrites++;\\r\\n        try {\\r\\n            await write();\\r\\n        }\\r\\n        finally {\\r\\n            this.pendingWrites--;\\r\\n        }\\r\\n    }\\r\\n    async _set(key, value) {\\r\\n        return this._withPendingWrite(async () => {\\r\\n            await this._withRetries((db) => _putObject(db, key, value));\\r\\n            this.localCache[key] = value;\\r\\n            return this.notifyServiceWorker(key);\\r\\n        });\\r\\n    }\\r\\n    async _get(key) {\\r\\n        const obj = (await this._withRetries((db) => getObject(db, key)));\\r\\n        this.localCache[key] = obj;\\r\\n        return obj;\\r\\n    }\\r\\n    async _remove(key) {\\r\\n        return this._withPendingWrite(async () => {\\r\\n            await this._withRetries((db) => _deleteObject(db, key));\\r\\n            delete this.localCache[key];\\r\\n            return this.notifyServiceWorker(key);\\r\\n        });\\r\\n    }\\r\\n    async _poll() {\\r\\n        // TODO: check if we need to fallback if getAll is not supported\\r\\n        const result = await this._withRetries((db) => {\\r\\n            const getAllRequest = getObjectStore(db, false).getAll();\\r\\n            return new DBPromise(getAllRequest).toPromise();\\r\\n        });\\r\\n        if (!result) {\\r\\n            return [];\\r\\n        }\\r\\n        // If we have pending writes in progress abort, we'll get picked up on the next poll\\r\\n        if (this.pendingWrites !== 0) {\\r\\n            return [];\\r\\n        }\\r\\n        const keys = [];\\r\\n        const keysInResult = new Set();\\r\\n        for (const { fbase_key: key, value } of result) {\\r\\n            keysInResult.add(key);\\r\\n            if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {\\r\\n                this.notifyListeners(key, value);\\r\\n                keys.push(key);\\r\\n            }\\r\\n        }\\r\\n        for (const localKey of Object.keys(this.localCache)) {\\r\\n            if (this.localCache[localKey] && !keysInResult.has(localKey)) {\\r\\n                // Deleted\\r\\n                this.notifyListeners(localKey, null);\\r\\n                keys.push(localKey);\\r\\n            }\\r\\n        }\\r\\n        return keys;\\r\\n    }\\r\\n    notifyListeners(key, newValue) {\\r\\n        this.localCache[key] = newValue;\\r\\n        const listeners = this.listeners[key];\\r\\n        if (listeners) {\\r\\n            for (const listener of Array.from(listeners)) {\\r\\n                listener(newValue);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    startPolling() {\\r\\n        this.stopPolling();\\r\\n        this.pollTimer = setInterval(async () => this._poll(), _POLLING_INTERVAL_MS);\\r\\n    }\\r\\n    stopPolling() {\\r\\n        if (this.pollTimer) {\\r\\n            clearInterval(this.pollTimer);\\r\\n            this.pollTimer = null;\\r\\n        }\\r\\n    }\\r\\n    _addListener(key, listener) {\\r\\n        if (Object.keys(this.listeners).length === 0) {\\r\\n            this.startPolling();\\r\\n        }\\r\\n        if (!this.listeners[key]) {\\r\\n            this.listeners[key] = new Set();\\r\\n            // Populate the cache to avoid spuriously triggering on first poll.\\r\\n            void this._get(key); // This can happen in the background async and we can return immediately.\\r\\n        }\\r\\n        this.listeners[key].add(listener);\\r\\n    }\\r\\n    _removeListener(key, listener) {\\r\\n        if (this.listeners[key]) {\\r\\n            this.listeners[key].delete(listener);\\r\\n            if (this.listeners[key].size === 0) {\\r\\n                delete this.listeners[key];\\r\\n            }\\r\\n        }\\r\\n        if (Object.keys(this.listeners).length === 0) {\\r\\n            this.stopPolling();\\r\\n        }\\r\\n    }\\r\\n}\\r\\nIndexedDBLocalPersistence.type = 'LOCAL';\\r\\n/**\\r\\n * An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`\\r\\n * for the underlying storage.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst indexedDBLocalPersistence = IndexedDBLocalPersistence;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction startSignInPhoneMfa(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v2/accounts/mfaSignIn:start\\\" /* START_PHONE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));\\r\\n}\\r\\nfunction finalizeSignInPhoneMfa(auth, request) {\\r\\n    return _performApiRequest(auth, \\\"POST\\\" /* POST */, \\\"/v2/accounts/mfaSignIn:finalize\\\" /* FINALIZE_PHONE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function getRecaptchaParams(auth) {\\r\\n    return ((await _performApiRequest(auth, \\\"GET\\\" /* GET */, \\\"/v1/recaptchaParams\\\" /* GET_RECAPTCHA_PARAM */)).recaptchaSiteKey || '');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getScriptParentElement() {\\r\\n    var _a, _b;\\r\\n    return (_b = (_a = document.getElementsByTagName('head')) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : document;\\r\\n}\\r\\nfunction _loadJS(url) {\\r\\n    // TODO: consider adding timeout support & cancellation\\r\\n    return new Promise((resolve, reject) => {\\r\\n        const el = document.createElement('script');\\r\\n        el.setAttribute('src', url);\\r\\n        el.onload = resolve;\\r\\n        el.onerror = e => {\\r\\n            const error = _createError(\\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n            error.customData = e;\\r\\n            reject(error);\\r\\n        };\\r\\n        el.type = 'text/javascript';\\r\\n        el.charset = 'UTF-8';\\r\\n        getScriptParentElement().appendChild(el);\\r\\n    });\\r\\n}\\r\\nfunction _generateCallbackName(prefix) {\\r\\n    return `__${prefix}${Math.floor(Math.random() * 1000000)}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst _SOLVE_TIME_MS = 500;\\r\\nconst _EXPIRATION_TIME_MS = 60000;\\r\\nconst _WIDGET_ID_START = 1000000000000;\\r\\nclass MockReCaptcha {\\r\\n    constructor(auth) {\\r\\n        this.auth = auth;\\r\\n        this.counter = _WIDGET_ID_START;\\r\\n        this._widgets = new Map();\\r\\n    }\\r\\n    render(container, parameters) {\\r\\n        const id = this.counter;\\r\\n        this._widgets.set(id, new MockWidget(container, this.auth.name, parameters || {}));\\r\\n        this.counter++;\\r\\n        return id;\\r\\n    }\\r\\n    reset(optWidgetId) {\\r\\n        var _a;\\r\\n        const id = optWidgetId || _WIDGET_ID_START;\\r\\n        void ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.delete());\\r\\n        this._widgets.delete(id);\\r\\n    }\\r\\n    getResponse(optWidgetId) {\\r\\n        var _a;\\r\\n        const id = optWidgetId || _WIDGET_ID_START;\\r\\n        return ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.getResponse()) || '';\\r\\n    }\\r\\n    async execute(optWidgetId) {\\r\\n        var _a;\\r\\n        const id = optWidgetId || _WIDGET_ID_START;\\r\\n        void ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.execute());\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\nclass MockWidget {\\r\\n    constructor(containerOrId, appName, params) {\\r\\n        this.params = params;\\r\\n        this.timerId = null;\\r\\n        this.deleted = false;\\r\\n        this.responseToken = null;\\r\\n        this.clickHandler = () => {\\r\\n            this.execute();\\r\\n        };\\r\\n        const container = typeof containerOrId === 'string'\\r\\n            ? document.getElementById(containerOrId)\\r\\n            : containerOrId;\\r\\n        _assert(container, \\\"argument-error\\\" /* ARGUMENT_ERROR */, { appName });\\r\\n        this.container = container;\\r\\n        this.isVisible = this.params.size !== 'invisible';\\r\\n        if (this.isVisible) {\\r\\n            this.execute();\\r\\n        }\\r\\n        else {\\r\\n            this.container.addEventListener('click', this.clickHandler);\\r\\n        }\\r\\n    }\\r\\n    getResponse() {\\r\\n        this.checkIfDeleted();\\r\\n        return this.responseToken;\\r\\n    }\\r\\n    delete() {\\r\\n        this.checkIfDeleted();\\r\\n        this.deleted = true;\\r\\n        if (this.timerId) {\\r\\n            clearTimeout(this.timerId);\\r\\n            this.timerId = null;\\r\\n        }\\r\\n        this.container.removeEventListener('click', this.clickHandler);\\r\\n    }\\r\\n    execute() {\\r\\n        this.checkIfDeleted();\\r\\n        if (this.timerId) {\\r\\n            return;\\r\\n        }\\r\\n        this.timerId = window.setTimeout(() => {\\r\\n            this.responseToken = generateRandomAlphaNumericString(50);\\r\\n            const { callback, 'expired-callback': expiredCallback } = this.params;\\r\\n            if (callback) {\\r\\n                try {\\r\\n                    callback(this.responseToken);\\r\\n                }\\r\\n                catch (e) { }\\r\\n            }\\r\\n            this.timerId = window.setTimeout(() => {\\r\\n                this.timerId = null;\\r\\n                this.responseToken = null;\\r\\n                if (expiredCallback) {\\r\\n                    try {\\r\\n                        expiredCallback();\\r\\n                    }\\r\\n                    catch (e) { }\\r\\n                }\\r\\n                if (this.isVisible) {\\r\\n                    this.execute();\\r\\n                }\\r\\n            }, _EXPIRATION_TIME_MS);\\r\\n        }, _SOLVE_TIME_MS);\\r\\n    }\\r\\n    checkIfDeleted() {\\r\\n        if (this.deleted) {\\r\\n            throw new Error('reCAPTCHA mock was already deleted!');\\r\\n        }\\r\\n    }\\r\\n}\\r\\nfunction generateRandomAlphaNumericString(len) {\\r\\n    const chars = [];\\r\\n    const allowedChars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\\r\\n    for (let i = 0; i < len; i++) {\\r\\n        chars.push(allowedChars.charAt(Math.floor(Math.random() * allowedChars.length)));\\r\\n    }\\r\\n    return chars.join('');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// ReCaptcha will load using the same callback, so the callback function needs\\r\\n// to be kept around\\r\\nconst _JSLOAD_CALLBACK = _generateCallbackName('rcb');\\r\\nconst NETWORK_TIMEOUT_DELAY = new Delay(30000, 60000);\\r\\nconst RECAPTCHA_BASE = 'https://www.google.com/recaptcha/api.js?';\\r\\n/**\\r\\n * Loader for the GReCaptcha library. There should only ever be one of this.\\r\\n */\\r\\nclass ReCaptchaLoaderImpl {\\r\\n    constructor() {\\r\\n        this.hostLanguage = '';\\r\\n        this.counter = 0;\\r\\n        this.librarySeparatelyLoaded = !!_window().grecaptcha;\\r\\n    }\\r\\n    load(auth, hl = '') {\\r\\n        _assert(isHostLanguageValid(hl), auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        if (this.shouldResolveImmediately(hl)) {\\r\\n            return Promise.resolve(_window().grecaptcha);\\r\\n        }\\r\\n        return new Promise((resolve, reject) => {\\r\\n            const networkTimeout = _window().setTimeout(() => {\\r\\n                reject(_createError(auth, \\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */));\\r\\n            }, NETWORK_TIMEOUT_DELAY.get());\\r\\n            _window()[_JSLOAD_CALLBACK] = () => {\\r\\n                _window().clearTimeout(networkTimeout);\\r\\n                delete _window()[_JSLOAD_CALLBACK];\\r\\n                const recaptcha = _window().grecaptcha;\\r\\n                if (!recaptcha) {\\r\\n                    reject(_createError(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */));\\r\\n                    return;\\r\\n                }\\r\\n                // Wrap the greptcha render function so that we know if the developer has\\r\\n                // called it separately\\r\\n                const render = recaptcha.render;\\r\\n                recaptcha.render = (container, params) => {\\r\\n                    const widgetId = render(container, params);\\r\\n                    this.counter++;\\r\\n                    return widgetId;\\r\\n                };\\r\\n                this.hostLanguage = hl;\\r\\n                resolve(recaptcha);\\r\\n            };\\r\\n            const url = `${RECAPTCHA_BASE}?${(0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystring)({\\r\\n                onload: _JSLOAD_CALLBACK,\\r\\n                render: 'explicit',\\r\\n                hl\\r\\n            })}`;\\r\\n            _loadJS(url).catch(() => {\\r\\n                clearTimeout(networkTimeout);\\r\\n                reject(_createError(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */));\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    clearedOneInstance() {\\r\\n        this.counter--;\\r\\n    }\\r\\n    shouldResolveImmediately(hl) {\\r\\n        // We can resolve immediately if:\\r\\n        //   • grecaptcha is already defined AND (\\r\\n        //     1. the requested language codes are the same OR\\r\\n        //     2. there exists already a ReCaptcha on the page\\r\\n        //     3. the library was already loaded by the app\\r\\n        // In cases (2) and (3), we _can't_ reload as it would break the recaptchas\\r\\n        // that are already in the page\\r\\n        return (!!_window().grecaptcha &&\\r\\n            (hl === this.hostLanguage ||\\r\\n                this.counter > 0 ||\\r\\n                this.librarySeparatelyLoaded));\\r\\n    }\\r\\n}\\r\\nfunction isHostLanguageValid(hl) {\\r\\n    return hl.length <= 6 && /^\\\\s*[a-zA-Z0-9\\\\-]*\\\\s*$/.test(hl);\\r\\n}\\r\\nclass MockReCaptchaLoaderImpl {\\r\\n    async load(auth) {\\r\\n        return new MockReCaptcha(auth);\\r\\n    }\\r\\n    clearedOneInstance() { }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst RECAPTCHA_VERIFIER_TYPE = 'recaptcha';\\r\\nconst DEFAULT_PARAMS = {\\r\\n    theme: 'light',\\r\\n    type: 'image'\\r\\n};\\r\\n/**\\r\\n * An {@link https://www.google.com/recaptcha/ | reCAPTCHA}-based application verifier.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass RecaptchaVerifier {\\r\\n    /**\\r\\n     *\\r\\n     * @param containerOrId - The reCAPTCHA container parameter.\\r\\n     *\\r\\n     * @remarks\\r\\n     * This has different meaning depending on whether the reCAPTCHA is hidden or visible. For a\\r\\n     * visible reCAPTCHA the container must be empty. If a string is used, it has to correspond to\\r\\n     * an element ID. The corresponding element must also must be in the DOM at the time of\\r\\n     * initialization.\\r\\n     *\\r\\n     * @param parameters - The optional reCAPTCHA parameters.\\r\\n     *\\r\\n     * @remarks\\r\\n     * Check the reCAPTCHA docs for a comprehensive list. All parameters are accepted except for\\r\\n     * the sitekey. Firebase Auth backend provisions a reCAPTCHA for each project and will\\r\\n     * configure this upon rendering. For an invisible reCAPTCHA, a size key must have the value\\r\\n     * 'invisible'.\\r\\n     *\\r\\n     * @param authExtern - The corresponding Firebase {@link Auth} instance.\\r\\n     *\\r\\n     * @remarks\\r\\n     * If none is provided, the default Firebase {@link Auth} instance is used. A Firebase {@link Auth} instance\\r\\n     * must be initialized with an API key, otherwise an error will be thrown.\\r\\n     */\\r\\n    constructor(containerOrId, parameters = Object.assign({}, DEFAULT_PARAMS), authExtern) {\\r\\n        this.parameters = parameters;\\r\\n        /**\\r\\n         * The application verifier type.\\r\\n         *\\r\\n         * @remarks\\r\\n         * For a reCAPTCHA verifier, this is 'recaptcha'.\\r\\n         */\\r\\n        this.type = RECAPTCHA_VERIFIER_TYPE;\\r\\n        this.destroyed = false;\\r\\n        this.widgetId = null;\\r\\n        this.tokenChangeListeners = new Set();\\r\\n        this.renderPromise = null;\\r\\n        this.recaptcha = null;\\r\\n        this.auth = _castAuth(authExtern);\\r\\n        this.isInvisible = this.parameters.size === 'invisible';\\r\\n        _assert(typeof document !== 'undefined', this.auth, \\\"operation-not-supported-in-this-environment\\\" /* OPERATION_NOT_SUPPORTED */);\\r\\n        const container = typeof containerOrId === 'string'\\r\\n            ? document.getElementById(containerOrId)\\r\\n            : containerOrId;\\r\\n        _assert(container, this.auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        this.container = container;\\r\\n        this.parameters.callback = this.makeTokenCallback(this.parameters.callback);\\r\\n        this._recaptchaLoader = this.auth.settings.appVerificationDisabledForTesting\\r\\n            ? new MockReCaptchaLoaderImpl()\\r\\n            : new ReCaptchaLoaderImpl();\\r\\n        this.validateStartingState();\\r\\n        // TODO: Figure out if sdk version is needed\\r\\n    }\\r\\n    /**\\r\\n     * Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA token.\\r\\n     *\\r\\n     * @returns A Promise for the reCAPTCHA token.\\r\\n     */\\r\\n    async verify() {\\r\\n        this.assertNotDestroyed();\\r\\n        const id = await this.render();\\r\\n        const recaptcha = this.getAssertedRecaptcha();\\r\\n        const response = recaptcha.getResponse(id);\\r\\n        if (response) {\\r\\n            return response;\\r\\n        }\\r\\n        return new Promise(resolve => {\\r\\n            const tokenChange = (token) => {\\r\\n                if (!token) {\\r\\n                    return; // Ignore token expirations.\\r\\n                }\\r\\n                this.tokenChangeListeners.delete(tokenChange);\\r\\n                resolve(token);\\r\\n            };\\r\\n            this.tokenChangeListeners.add(tokenChange);\\r\\n            if (this.isInvisible) {\\r\\n                recaptcha.execute(id);\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Renders the reCAPTCHA widget on the page.\\r\\n     *\\r\\n     * @returns A Promise that resolves with the reCAPTCHA widget ID.\\r\\n     */\\r\\n    render() {\\r\\n        try {\\r\\n            this.assertNotDestroyed();\\r\\n        }\\r\\n        catch (e) {\\r\\n            // This method returns a promise. Since it's not async (we want to return the\\r\\n            // _same_ promise if rendering is still occurring), the API surface should\\r\\n            // reject with the error rather than just throw\\r\\n            return Promise.reject(e);\\r\\n        }\\r\\n        if (this.renderPromise) {\\r\\n            return this.renderPromise;\\r\\n        }\\r\\n        this.renderPromise = this.makeRenderPromise().catch(e => {\\r\\n            this.renderPromise = null;\\r\\n            throw e;\\r\\n        });\\r\\n        return this.renderPromise;\\r\\n    }\\r\\n    /** @internal */\\r\\n    _reset() {\\r\\n        this.assertNotDestroyed();\\r\\n        if (this.widgetId !== null) {\\r\\n            this.getAssertedRecaptcha().reset(this.widgetId);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Clears the reCAPTCHA widget from the page and destroys the instance.\\r\\n     */\\r\\n    clear() {\\r\\n        this.assertNotDestroyed();\\r\\n        this.destroyed = true;\\r\\n        this._recaptchaLoader.clearedOneInstance();\\r\\n        if (!this.isInvisible) {\\r\\n            this.container.childNodes.forEach(node => {\\r\\n                this.container.removeChild(node);\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    validateStartingState() {\\r\\n        _assert(!this.parameters.sitekey, this.auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        _assert(this.isInvisible || !this.container.hasChildNodes(), this.auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        _assert(typeof document !== 'undefined', this.auth, \\\"operation-not-supported-in-this-environment\\\" /* OPERATION_NOT_SUPPORTED */);\\r\\n    }\\r\\n    makeTokenCallback(existing) {\\r\\n        return token => {\\r\\n            this.tokenChangeListeners.forEach(listener => listener(token));\\r\\n            if (typeof existing === 'function') {\\r\\n                existing(token);\\r\\n            }\\r\\n            else if (typeof existing === 'string') {\\r\\n                const globalFunc = _window()[existing];\\r\\n                if (typeof globalFunc === 'function') {\\r\\n                    globalFunc(token);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n    assertNotDestroyed() {\\r\\n        _assert(!this.destroyed, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    }\\r\\n    async makeRenderPromise() {\\r\\n        await this.init();\\r\\n        if (!this.widgetId) {\\r\\n            let container = this.container;\\r\\n            if (!this.isInvisible) {\\r\\n                const guaranteedEmpty = document.createElement('div');\\r\\n                container.appendChild(guaranteedEmpty);\\r\\n                container = guaranteedEmpty;\\r\\n            }\\r\\n            this.widgetId = this.getAssertedRecaptcha().render(container, this.parameters);\\r\\n        }\\r\\n        return this.widgetId;\\r\\n    }\\r\\n    async init() {\\r\\n        _assert(_isHttpOrHttps() && !_isWorker(), this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        await domReady();\\r\\n        this.recaptcha = await this._recaptchaLoader.load(this.auth, this.auth.languageCode || undefined);\\r\\n        const siteKey = await getRecaptchaParams(this.auth);\\r\\n        _assert(siteKey, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        this.parameters.sitekey = siteKey;\\r\\n    }\\r\\n    getAssertedRecaptcha() {\\r\\n        _assert(this.recaptcha, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        return this.recaptcha;\\r\\n    }\\r\\n}\\r\\nfunction domReady() {\\r\\n    let resolver = null;\\r\\n    return new Promise(resolve => {\\r\\n        if (document.readyState === 'complete') {\\r\\n            resolve();\\r\\n            return;\\r\\n        }\\r\\n        // Document not ready, wait for load before resolving.\\r\\n        // Save resolver, so we can remove listener in case it was externally\\r\\n        // cancelled.\\r\\n        resolver = () => resolve();\\r\\n        window.addEventListener('load', resolver);\\r\\n    }).catch(e => {\\r\\n        if (resolver) {\\r\\n            window.removeEventListener('load', resolver);\\r\\n        }\\r\\n        throw e;\\r\\n    });\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass ConfirmationResultImpl {\\r\\n    constructor(verificationId, onConfirmation) {\\r\\n        this.verificationId = verificationId;\\r\\n        this.onConfirmation = onConfirmation;\\r\\n    }\\r\\n    confirm(verificationCode) {\\r\\n        const authCredential = PhoneAuthCredential._fromVerification(this.verificationId, verificationCode);\\r\\n        return this.onConfirmation(authCredential);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Asynchronously signs in using a phone number.\\r\\n *\\r\\n * @remarks\\r\\n * This method sends a code via SMS to the given\\r\\n * phone number, and returns a {@link ConfirmationResult}. After the user\\r\\n * provides the code sent to their phone, call {@link ConfirmationResult.confirm}\\r\\n * with the code to sign the user in.\\r\\n *\\r\\n * For abuse prevention, this method also requires a {@link ApplicationVerifier}.\\r\\n * This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.\\r\\n * This function can work on other platforms that do not support the\\r\\n * {@link RecaptchaVerifier} (like React Native), but you need to use a\\r\\n * third-party {@link ApplicationVerifier} implementation.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // 'recaptcha-container' is the ID of an element in the DOM.\\r\\n * const applicationVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');\\r\\n * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\\r\\n * // Obtain a verificationCode from the user.\\r\\n * const credential = await confirmationResult.confirm(verificationCode);\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\\r\\n * @param appVerifier - The {@link ApplicationVerifier}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function signInWithPhoneNumber(auth, phoneNumber, appVerifier) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    const verificationId = await _verifyPhoneNumber(authInternal, phoneNumber, (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(appVerifier));\\r\\n    return new ConfirmationResultImpl(verificationId, cred => signInWithCredential(authInternal, cred));\\r\\n}\\r\\n/**\\r\\n * Links the user account with the given phone number.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\\r\\n * @param appVerifier - The {@link ApplicationVerifier}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function linkWithPhoneNumber(user, phoneNumber, appVerifier) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    await _assertLinkedStatus(false, userInternal, \\\"phone\\\" /* PHONE */);\\r\\n    const verificationId = await _verifyPhoneNumber(userInternal.auth, phoneNumber, (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(appVerifier));\\r\\n    return new ConfirmationResultImpl(verificationId, cred => linkWithCredential(userInternal, cred));\\r\\n}\\r\\n/**\\r\\n * Re-authenticates a user using a fresh phone credential.\\r\\n *\\r\\n * @remarks Use before operations such as {@link updatePassword} that require tokens from recent sign-in attempts.\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\\r\\n * @param appVerifier - The {@link ApplicationVerifier}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function reauthenticateWithPhoneNumber(user, phoneNumber, appVerifier) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    const verificationId = await _verifyPhoneNumber(userInternal.auth, phoneNumber, (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(appVerifier));\\r\\n    return new ConfirmationResultImpl(verificationId, cred => reauthenticateWithCredential(userInternal, cred));\\r\\n}\\r\\n/**\\r\\n * Returns a verification ID to be used in conjunction with the SMS code that is sent.\\r\\n *\\r\\n */\\r\\nasync function _verifyPhoneNumber(auth, options, verifier) {\\r\\n    var _a;\\r\\n    const recaptchaToken = await verifier.verify();\\r\\n    try {\\r\\n        _assert(typeof recaptchaToken === 'string', auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        _assert(verifier.type === RECAPTCHA_VERIFIER_TYPE, auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n        let phoneInfoOptions;\\r\\n        if (typeof options === 'string') {\\r\\n            phoneInfoOptions = {\\r\\n                phoneNumber: options\\r\\n            };\\r\\n        }\\r\\n        else {\\r\\n            phoneInfoOptions = options;\\r\\n        }\\r\\n        if ('session' in phoneInfoOptions) {\\r\\n            const session = phoneInfoOptions.session;\\r\\n            if ('phoneNumber' in phoneInfoOptions) {\\r\\n                _assert(session.type === \\\"enroll\\\" /* ENROLL */, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n                const response = await startEnrollPhoneMfa(auth, {\\r\\n                    idToken: session.credential,\\r\\n                    phoneEnrollmentInfo: {\\r\\n                        phoneNumber: phoneInfoOptions.phoneNumber,\\r\\n                        recaptchaToken\\r\\n                    }\\r\\n                });\\r\\n                return response.phoneSessionInfo.sessionInfo;\\r\\n            }\\r\\n            else {\\r\\n                _assert(session.type === \\\"signin\\\" /* SIGN_IN */, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n                const mfaEnrollmentId = ((_a = phoneInfoOptions.multiFactorHint) === null || _a === void 0 ? void 0 : _a.uid) ||\\r\\n                    phoneInfoOptions.multiFactorUid;\\r\\n                _assert(mfaEnrollmentId, auth, \\\"missing-multi-factor-info\\\" /* MISSING_MFA_INFO */);\\r\\n                const response = await startSignInPhoneMfa(auth, {\\r\\n                    mfaPendingCredential: session.credential,\\r\\n                    mfaEnrollmentId,\\r\\n                    phoneSignInInfo: {\\r\\n                        recaptchaToken\\r\\n                    }\\r\\n                });\\r\\n                return response.phoneResponseInfo.sessionInfo;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            const { sessionInfo } = await sendPhoneVerificationCode(auth, {\\r\\n                phoneNumber: phoneInfoOptions.phoneNumber,\\r\\n                recaptchaToken\\r\\n            });\\r\\n            return sessionInfo;\\r\\n        }\\r\\n    }\\r\\n    finally {\\r\\n        verifier._reset();\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Updates the user's phone number.\\r\\n *\\r\\n * @example\\r\\n * ```\\r\\n * // 'recaptcha-container' is the ID of an element in the DOM.\\r\\n * const applicationVerifier = new RecaptchaVerifier('recaptcha-container');\\r\\n * const provider = new PhoneAuthProvider(auth);\\r\\n * const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);\\r\\n * // Obtain the verificationCode from the user.\\r\\n * const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\\r\\n * await updatePhoneNumber(user, phoneCredential);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param credential - A credential authenticating the new phone number.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function updatePhoneNumber(user, credential) {\\r\\n    await _link$1((0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user), credential);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for generating an {@link PhoneAuthCredential}.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // 'recaptcha-container' is the ID of an element in the DOM.\\r\\n * const applicationVerifier = new RecaptchaVerifier('recaptcha-container');\\r\\n * const provider = new PhoneAuthProvider(auth);\\r\\n * const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);\\r\\n * // Obtain the verificationCode from the user.\\r\\n * const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\\r\\n * const userCredential = await signInWithCredential(auth, phoneCredential);\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass PhoneAuthProvider {\\r\\n    /**\\r\\n     * @param auth - The Firebase {@link Auth} instance in which sign-ins should occur.\\r\\n     *\\r\\n     */\\r\\n    constructor(auth) {\\r\\n        /** Always set to {@link ProviderId}.PHONE. */\\r\\n        this.providerId = PhoneAuthProvider.PROVIDER_ID;\\r\\n        this.auth = _castAuth(auth);\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * Starts a phone number authentication flow by sending a verification code to the given phone\\r\\n     * number.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * const provider = new PhoneAuthProvider(auth);\\r\\n     * const verificationId = await provider.verifyPhoneNumber(phoneNumber, applicationVerifier);\\r\\n     * // Obtain verificationCode from the user.\\r\\n     * const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\\r\\n     * const userCredential = await signInWithCredential(auth, authCredential);\\r\\n     * ```\\r\\n     *\\r\\n     * @example\\r\\n     * An alternative flow is provided using the `signInWithPhoneNumber` method.\\r\\n     * ```javascript\\r\\n     * const confirmationResult = signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\\r\\n     * // Obtain verificationCode from the user.\\r\\n     * const userCredential = confirmationResult.confirm(verificationCode);\\r\\n     * ```\\r\\n     *\\r\\n     * @param phoneInfoOptions - The user's {@link PhoneInfoOptions}. The phone number should be in\\r\\n     * E.164 format (e.g. +16505550101).\\r\\n     * @param applicationVerifier - For abuse prevention, this method also requires a\\r\\n     * {@link ApplicationVerifier}. This SDK includes a reCAPTCHA-based implementation,\\r\\n     * {@link RecaptchaVerifier}.\\r\\n     *\\r\\n     * @returns A Promise for a verification ID that can be passed to\\r\\n     * {@link PhoneAuthProvider.credential} to identify this flow..\\r\\n     */\\r\\n    verifyPhoneNumber(phoneOptions, applicationVerifier) {\\r\\n        return _verifyPhoneNumber(this.auth, phoneOptions, (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(applicationVerifier));\\r\\n    }\\r\\n    /**\\r\\n     * Creates a phone auth credential, given the verification ID from\\r\\n     * {@link PhoneAuthProvider.verifyPhoneNumber} and the code that was sent to the user's\\r\\n     * mobile device.\\r\\n     *\\r\\n     * @example\\r\\n     * ```javascript\\r\\n     * const provider = new PhoneAuthProvider(auth);\\r\\n     * const verificationId = provider.verifyPhoneNumber(phoneNumber, applicationVerifier);\\r\\n     * // Obtain verificationCode from the user.\\r\\n     * const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\\r\\n     * const userCredential = signInWithCredential(auth, authCredential);\\r\\n     * ```\\r\\n     *\\r\\n     * @example\\r\\n     * An alternative flow is provided using the `signInWithPhoneNumber` method.\\r\\n     * ```javascript\\r\\n     * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\\r\\n     * // Obtain verificationCode from the user.\\r\\n     * const userCredential = await confirmationResult.confirm(verificationCode);\\r\\n     * ```\\r\\n     *\\r\\n     * @param verificationId - The verification ID returned from {@link PhoneAuthProvider.verifyPhoneNumber}.\\r\\n     * @param verificationCode - The verification code sent to the user's mobile device.\\r\\n     *\\r\\n     * @returns The auth provider credential.\\r\\n     */\\r\\n    static credential(verificationId, verificationCode) {\\r\\n        return PhoneAuthCredential._fromVerification(verificationId, verificationCode);\\r\\n    }\\r\\n    /**\\r\\n     * Generates an {@link AuthCredential} from a {@link UserCredential}.\\r\\n     * @param userCredential - The user credential.\\r\\n     */\\r\\n    static credentialFromResult(userCredential) {\\r\\n        const credential = userCredential;\\r\\n        return PhoneAuthProvider.credentialFromTaggedObject(credential);\\r\\n    }\\r\\n    /**\\r\\n     * Returns an {@link AuthCredential} when passed an error.\\r\\n     *\\r\\n     * @remarks\\r\\n     *\\r\\n     * This method works for errors like\\r\\n     * `auth/account-exists-with-different-credentials`. This is useful for\\r\\n     * recovering when attempting to set a user's phone number but the number\\r\\n     * in question is already tied to another account. For example, the following\\r\\n     * code tries to update the current user's phone number, and if that\\r\\n     * fails, links the user with the account associated with that number:\\r\\n     *\\r\\n     * ```js\\r\\n     * const provider = new PhoneAuthProvider(auth);\\r\\n     * const verificationId = await provider.verifyPhoneNumber(number, verifier);\\r\\n     * try {\\r\\n     *   const code = ''; // Prompt the user for the verification code\\r\\n     *   await updatePhoneNumber(\\r\\n     *       auth.currentUser,\\r\\n     *       PhoneAuthProvider.credential(verificationId, code));\\r\\n     * } catch (e) {\\r\\n     *   if (e.code === 'auth/account-exists-with-different-credential') {\\r\\n     *     const cred = PhoneAuthProvider.credentialFromError(e);\\r\\n     *     await linkWithCredential(auth.currentUser, cred);\\r\\n     *   }\\r\\n     * }\\r\\n     *\\r\\n     * // At this point, auth.currentUser.phoneNumber === number.\\r\\n     * ```\\r\\n     *\\r\\n     * @param error - The error to generate a credential from.\\r\\n     */\\r\\n    static credentialFromError(error) {\\r\\n        return PhoneAuthProvider.credentialFromTaggedObject((error.customData || {}));\\r\\n    }\\r\\n    static credentialFromTaggedObject({ _tokenResponse: tokenResponse }) {\\r\\n        if (!tokenResponse) {\\r\\n            return null;\\r\\n        }\\r\\n        const { phoneNumber, temporaryProof } = tokenResponse;\\r\\n        if (phoneNumber && temporaryProof) {\\r\\n            return PhoneAuthCredential._fromTokenResponse(phoneNumber, temporaryProof);\\r\\n        }\\r\\n        return null;\\r\\n    }\\r\\n}\\r\\n/** Always set to {@link ProviderId}.PHONE. */\\r\\nPhoneAuthProvider.PROVIDER_ID = \\\"phone\\\" /* PHONE */;\\r\\n/** Always set to {@link SignInMethod}.PHONE. */\\r\\nPhoneAuthProvider.PHONE_SIGN_IN_METHOD = \\\"phone\\\" /* PHONE */;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Chooses a popup/redirect resolver to use. This prefers the override (which\\r\\n * is directly passed in), and falls back to the property set on the auth\\r\\n * object. If neither are available, this function errors w/ an argument error.\\r\\n */\\r\\nfunction _withDefaultResolver(auth, resolverOverride) {\\r\\n    if (resolverOverride) {\\r\\n        return _getInstance(resolverOverride);\\r\\n    }\\r\\n    _assert(auth._popupRedirectResolver, auth, \\\"argument-error\\\" /* ARGUMENT_ERROR */);\\r\\n    return auth._popupRedirectResolver;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass IdpCredential extends AuthCredential {\\r\\n    constructor(params) {\\r\\n        super(\\\"custom\\\" /* CUSTOM */, \\\"custom\\\" /* CUSTOM */);\\r\\n        this.params = params;\\r\\n    }\\r\\n    _getIdTokenResponse(auth) {\\r\\n        return signInWithIdp(auth, this._buildIdpRequest());\\r\\n    }\\r\\n    _linkToIdToken(auth, idToken) {\\r\\n        return signInWithIdp(auth, this._buildIdpRequest(idToken));\\r\\n    }\\r\\n    _getReauthenticationResolver(auth) {\\r\\n        return signInWithIdp(auth, this._buildIdpRequest());\\r\\n    }\\r\\n    _buildIdpRequest(idToken) {\\r\\n        const request = {\\r\\n            requestUri: this.params.requestUri,\\r\\n            sessionId: this.params.sessionId,\\r\\n            postBody: this.params.postBody,\\r\\n            tenantId: this.params.tenantId,\\r\\n            pendingToken: this.params.pendingToken,\\r\\n            returnSecureToken: true,\\r\\n            returnIdpCredential: true\\r\\n        };\\r\\n        if (idToken) {\\r\\n            request.idToken = idToken;\\r\\n        }\\r\\n        return request;\\r\\n    }\\r\\n}\\r\\nfunction _signIn(params) {\\r\\n    return _signInWithCredential(params.auth, new IdpCredential(params), params.bypassAuthState);\\r\\n}\\r\\nfunction _reauth(params) {\\r\\n    const { auth, user } = params;\\r\\n    _assert(user, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    return _reauthenticate(user, new IdpCredential(params), params.bypassAuthState);\\r\\n}\\r\\nasync function _link(params) {\\r\\n    const { auth, user } = params;\\r\\n    _assert(user, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    return _link$1(user, new IdpCredential(params), params.bypassAuthState);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Popup event manager. Handles the popup's entire lifecycle; listens to auth\\r\\n * events\\r\\n */\\r\\nclass AbstractPopupRedirectOperation {\\r\\n    constructor(auth, filter, resolver, user, bypassAuthState = false) {\\r\\n        this.auth = auth;\\r\\n        this.resolver = resolver;\\r\\n        this.user = user;\\r\\n        this.bypassAuthState = bypassAuthState;\\r\\n        this.pendingPromise = null;\\r\\n        this.eventManager = null;\\r\\n        this.filter = Array.isArray(filter) ? filter : [filter];\\r\\n    }\\r\\n    execute() {\\r\\n        return new Promise(async (resolve, reject) => {\\r\\n            this.pendingPromise = { resolve, reject };\\r\\n            try {\\r\\n                this.eventManager = await this.resolver._initialize(this.auth);\\r\\n                await this.onExecution();\\r\\n                this.eventManager.registerConsumer(this);\\r\\n            }\\r\\n            catch (e) {\\r\\n                this.reject(e);\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    async onAuthEvent(event) {\\r\\n        const { urlResponse, sessionId, postBody, tenantId, error, type } = event;\\r\\n        if (error) {\\r\\n            this.reject(error);\\r\\n            return;\\r\\n        }\\r\\n        const params = {\\r\\n            auth: this.auth,\\r\\n            requestUri: urlResponse,\\r\\n            sessionId: sessionId,\\r\\n            tenantId: tenantId || undefined,\\r\\n            postBody: postBody || undefined,\\r\\n            user: this.user,\\r\\n            bypassAuthState: this.bypassAuthState\\r\\n        };\\r\\n        try {\\r\\n            this.resolve(await this.getIdpTask(type)(params));\\r\\n        }\\r\\n        catch (e) {\\r\\n            this.reject(e);\\r\\n        }\\r\\n    }\\r\\n    onError(error) {\\r\\n        this.reject(error);\\r\\n    }\\r\\n    getIdpTask(type) {\\r\\n        switch (type) {\\r\\n            case \\\"signInViaPopup\\\" /* SIGN_IN_VIA_POPUP */:\\r\\n            case \\\"signInViaRedirect\\\" /* SIGN_IN_VIA_REDIRECT */:\\r\\n                return _signIn;\\r\\n            case \\\"linkViaPopup\\\" /* LINK_VIA_POPUP */:\\r\\n            case \\\"linkViaRedirect\\\" /* LINK_VIA_REDIRECT */:\\r\\n                return _link;\\r\\n            case \\\"reauthViaPopup\\\" /* REAUTH_VIA_POPUP */:\\r\\n            case \\\"reauthViaRedirect\\\" /* REAUTH_VIA_REDIRECT */:\\r\\n                return _reauth;\\r\\n            default:\\r\\n                _fail(this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        }\\r\\n    }\\r\\n    resolve(cred) {\\r\\n        debugAssert(this.pendingPromise, 'Pending promise was never set');\\r\\n        this.pendingPromise.resolve(cred);\\r\\n        this.unregisterAndCleanUp();\\r\\n    }\\r\\n    reject(error) {\\r\\n        debugAssert(this.pendingPromise, 'Pending promise was never set');\\r\\n        this.pendingPromise.reject(error);\\r\\n        this.unregisterAndCleanUp();\\r\\n    }\\r\\n    unregisterAndCleanUp() {\\r\\n        if (this.eventManager) {\\r\\n            this.eventManager.unregisterConsumer(this);\\r\\n        }\\r\\n        this.pendingPromise = null;\\r\\n        this.cleanUp();\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst _POLL_WINDOW_CLOSE_TIMEOUT = new Delay(2000, 10000);\\r\\n/**\\r\\n * Authenticates a Firebase client using a popup-based OAuth authentication flow.\\r\\n *\\r\\n * @remarks\\r\\n * If succeeds, returns the signed in user along with the provider's credential. If sign in was\\r\\n * unsuccessful, returns an error object containing additional information about the error.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n *\\r\\n * // The signed-in user info.\\r\\n * const user = result.user;\\r\\n * // This gives you a Facebook Access Token.\\r\\n * const credential = provider.credentialFromResult(auth, result);\\r\\n * const token = credential.accessToken;\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\\r\\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function signInWithPopup(auth, provider, resolver) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    _assertInstanceOf(auth, provider, FederatedAuthProvider);\\r\\n    const resolverInternal = _withDefaultResolver(authInternal, resolver);\\r\\n    const action = new PopupOperation(authInternal, \\\"signInViaPopup\\\" /* SIGN_IN_VIA_POPUP */, provider, resolverInternal);\\r\\n    return action.executeNotNull();\\r\\n}\\r\\n/**\\r\\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a pop-up based\\r\\n * OAuth flow.\\r\\n *\\r\\n * @remarks\\r\\n * If the reauthentication is successful, the returned result will contain the user and the\\r\\n * provider's credential.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a popup.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * const result = await signInWithPopup(auth, provider);\\r\\n * // Reauthenticate using a popup.\\r\\n * await reauthenticateWithPopup(result.user, provider);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\\r\\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function reauthenticateWithPopup(user, provider, resolver) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\\r\\n    const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\\r\\n    const action = new PopupOperation(userInternal.auth, \\\"reauthViaPopup\\\" /* REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);\\r\\n    return action.executeNotNull();\\r\\n}\\r\\n/**\\r\\n * Links the authenticated provider to the user account using a pop-up based OAuth flow.\\r\\n *\\r\\n * @remarks\\r\\n * If the linking is successful, the returned result will contain the user and the provider's credential.\\r\\n *\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using some other provider.\\r\\n * const result = await signInWithEmailAndPassword(auth, email, password);\\r\\n * // Link using a popup.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * await linkWithPopup(result.user, provider);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\\r\\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function linkWithPopup(user, provider, resolver) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\\r\\n    const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\\r\\n    const action = new PopupOperation(userInternal.auth, \\\"linkViaPopup\\\" /* LINK_VIA_POPUP */, provider, resolverInternal, userInternal);\\r\\n    return action.executeNotNull();\\r\\n}\\r\\n/**\\r\\n * Popup event manager. Handles the popup's entire lifecycle; listens to auth\\r\\n * events\\r\\n *\\r\\n */\\r\\nclass PopupOperation extends AbstractPopupRedirectOperation {\\r\\n    constructor(auth, filter, provider, resolver, user) {\\r\\n        super(auth, filter, resolver, user);\\r\\n        this.provider = provider;\\r\\n        this.authWindow = null;\\r\\n        this.pollId = null;\\r\\n        if (PopupOperation.currentPopupAction) {\\r\\n            PopupOperation.currentPopupAction.cancel();\\r\\n        }\\r\\n        PopupOperation.currentPopupAction = this;\\r\\n    }\\r\\n    async executeNotNull() {\\r\\n        const result = await this.execute();\\r\\n        _assert(result, this.auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        return result;\\r\\n    }\\r\\n    async onExecution() {\\r\\n        debugAssert(this.filter.length === 1, 'Popup operations only handle one event');\\r\\n        const eventId = _generateEventId();\\r\\n        this.authWindow = await this.resolver._openPopup(this.auth, this.provider, this.filter[0], // There's always one, see constructor\\r\\n        eventId);\\r\\n        this.authWindow.associatedEvent = eventId;\\r\\n        // Check for web storage support and origin validation _after_ the popup is\\r\\n        // loaded. These operations are slow (~1 second or so) Rather than\\r\\n        // waiting on them before opening the window, optimistically open the popup\\r\\n        // and check for storage support at the same time. If storage support is\\r\\n        // not available, this will cause the whole thing to reject properly. It\\r\\n        // will also close the popup, but since the promise has already rejected,\\r\\n        // the popup closed by user poll will reject into the void.\\r\\n        this.resolver._originValidation(this.auth).catch(e => {\\r\\n            this.reject(e);\\r\\n        });\\r\\n        this.resolver._isIframeWebStorageSupported(this.auth, isSupported => {\\r\\n            if (!isSupported) {\\r\\n                this.reject(_createError(this.auth, \\\"web-storage-unsupported\\\" /* WEB_STORAGE_UNSUPPORTED */));\\r\\n            }\\r\\n        });\\r\\n        // Handle user closure. Notice this does *not* use await\\r\\n        this.pollUserCancellation();\\r\\n    }\\r\\n    get eventId() {\\r\\n        var _a;\\r\\n        return ((_a = this.authWindow) === null || _a === void 0 ? void 0 : _a.associatedEvent) || null;\\r\\n    }\\r\\n    cancel() {\\r\\n        this.reject(_createError(this.auth, \\\"cancelled-popup-request\\\" /* EXPIRED_POPUP_REQUEST */));\\r\\n    }\\r\\n    cleanUp() {\\r\\n        if (this.authWindow) {\\r\\n            this.authWindow.close();\\r\\n        }\\r\\n        if (this.pollId) {\\r\\n            window.clearTimeout(this.pollId);\\r\\n        }\\r\\n        this.authWindow = null;\\r\\n        this.pollId = null;\\r\\n        PopupOperation.currentPopupAction = null;\\r\\n    }\\r\\n    pollUserCancellation() {\\r\\n        const poll = () => {\\r\\n            var _a, _b;\\r\\n            if ((_b = (_a = this.authWindow) === null || _a === void 0 ? void 0 : _a.window) === null || _b === void 0 ? void 0 : _b.closed) {\\r\\n                // Make sure that there is sufficient time for whatever action to\\r\\n                // complete. The window could have closed but the sign in network\\r\\n                // call could still be in flight.\\r\\n                this.pollId = window.setTimeout(() => {\\r\\n                    this.pollId = null;\\r\\n                    this.reject(_createError(this.auth, \\\"popup-closed-by-user\\\" /* POPUP_CLOSED_BY_USER */));\\r\\n                }, 2000 /* AUTH_EVENT */);\\r\\n                return;\\r\\n            }\\r\\n            this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());\\r\\n        };\\r\\n        poll();\\r\\n    }\\r\\n}\\r\\n// Only one popup is ever shown at once. The lifecycle of the current popup\\r\\n// can be managed / cancelled by the constructor.\\r\\nPopupOperation.currentPopupAction = null;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst PENDING_REDIRECT_KEY = 'pendingRedirect';\\r\\n// We only get one redirect outcome for any one auth, so just store it\\r\\n// in here.\\r\\nconst redirectOutcomeMap = new Map();\\r\\nclass RedirectAction extends AbstractPopupRedirectOperation {\\r\\n    constructor(auth, resolver, bypassAuthState = false) {\\r\\n        super(auth, [\\r\\n            \\\"signInViaRedirect\\\" /* SIGN_IN_VIA_REDIRECT */,\\r\\n            \\\"linkViaRedirect\\\" /* LINK_VIA_REDIRECT */,\\r\\n            \\\"reauthViaRedirect\\\" /* REAUTH_VIA_REDIRECT */,\\r\\n            \\\"unknown\\\" /* UNKNOWN */\\r\\n        ], resolver, undefined, bypassAuthState);\\r\\n        this.eventId = null;\\r\\n    }\\r\\n    /**\\r\\n     * Override the execute function; if we already have a redirect result, then\\r\\n     * just return it.\\r\\n     */\\r\\n    async execute() {\\r\\n        let readyOutcome = redirectOutcomeMap.get(this.auth._key());\\r\\n        if (!readyOutcome) {\\r\\n            try {\\r\\n                const hasPendingRedirect = await _getAndClearPendingRedirectStatus(this.resolver, this.auth);\\r\\n                const result = hasPendingRedirect ? await super.execute() : null;\\r\\n                readyOutcome = () => Promise.resolve(result);\\r\\n            }\\r\\n            catch (e) {\\r\\n                readyOutcome = () => Promise.reject(e);\\r\\n            }\\r\\n            redirectOutcomeMap.set(this.auth._key(), readyOutcome);\\r\\n        }\\r\\n        // If we're not bypassing auth state, the ready outcome should be set to\\r\\n        // null.\\r\\n        if (!this.bypassAuthState) {\\r\\n            redirectOutcomeMap.set(this.auth._key(), () => Promise.resolve(null));\\r\\n        }\\r\\n        return readyOutcome();\\r\\n    }\\r\\n    async onAuthEvent(event) {\\r\\n        if (event.type === \\\"signInViaRedirect\\\" /* SIGN_IN_VIA_REDIRECT */) {\\r\\n            return super.onAuthEvent(event);\\r\\n        }\\r\\n        else if (event.type === \\\"unknown\\\" /* UNKNOWN */) {\\r\\n            // This is a sentinel value indicating there's no pending redirect\\r\\n            this.resolve(null);\\r\\n            return;\\r\\n        }\\r\\n        if (event.eventId) {\\r\\n            const user = await this.auth._redirectUserForId(event.eventId);\\r\\n            if (user) {\\r\\n                this.user = user;\\r\\n                return super.onAuthEvent(event);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(null);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    async onExecution() { }\\r\\n    cleanUp() { }\\r\\n}\\r\\nasync function _getAndClearPendingRedirectStatus(resolver, auth) {\\r\\n    const key = pendingRedirectKey(auth);\\r\\n    const persistence = resolverPersistence(resolver);\\r\\n    if (!(await persistence._isAvailable())) {\\r\\n        return false;\\r\\n    }\\r\\n    const hasPendingRedirect = (await persistence._get(key)) === 'true';\\r\\n    await persistence._remove(key);\\r\\n    return hasPendingRedirect;\\r\\n}\\r\\nasync function _setPendingRedirectStatus(resolver, auth) {\\r\\n    return resolverPersistence(resolver)._set(pendingRedirectKey(auth), 'true');\\r\\n}\\r\\nfunction _clearRedirectOutcomes() {\\r\\n    redirectOutcomeMap.clear();\\r\\n}\\r\\nfunction _overrideRedirectResult(auth, result) {\\r\\n    redirectOutcomeMap.set(auth._key(), result);\\r\\n}\\r\\nfunction resolverPersistence(resolver) {\\r\\n    return _getInstance(resolver._redirectPersistence);\\r\\n}\\r\\nfunction pendingRedirectKey(auth) {\\r\\n    return _persistenceKeyName(PENDING_REDIRECT_KEY, auth.config.apiKey, auth.name);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Authenticates a Firebase client using a full-page redirect flow.\\r\\n *\\r\\n * @remarks\\r\\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * // You can add additional scopes to the provider:\\r\\n * provider.addScope('user_birthday');\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a Facebook Access Token.\\r\\n *   const credential = provider.credentialFromResult(auth, result);\\r\\n *   const token = credential.accessToken;\\r\\n * }\\r\\n * // As this API can be used for sign-in, linking and reauthentication,\\r\\n * // check the operationType to determine what triggered this redirect\\r\\n * // operation.\\r\\n * const operationType = result.operationType;\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\\r\\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction signInWithRedirect(auth, provider, resolver) {\\r\\n    return _signInWithRedirect(auth, provider, resolver);\\r\\n}\\r\\nasync function _signInWithRedirect(auth, provider, resolver) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    _assertInstanceOf(auth, provider, FederatedAuthProvider);\\r\\n    const resolverInternal = _withDefaultResolver(authInternal, resolver);\\r\\n    await _setPendingRedirectStatus(resolverInternal, authInternal);\\r\\n    return resolverInternal._openRedirect(authInternal, provider, \\\"signInViaRedirect\\\" /* SIGN_IN_VIA_REDIRECT */);\\r\\n}\\r\\n/**\\r\\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * const result = await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * // Link using a redirect.\\r\\n * await linkWithRedirect(result.user, provider);\\r\\n * // This will again trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\\r\\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction reauthenticateWithRedirect(user, provider, resolver) {\\r\\n    return _reauthenticateWithRedirect(user, provider, resolver);\\r\\n}\\r\\nasync function _reauthenticateWithRedirect(user, provider, resolver) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\\r\\n    // Allow the resolver to error before persisting the redirect user\\r\\n    const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\\r\\n    await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\\r\\n    const eventId = await prepareUserForRedirect(userInternal);\\r\\n    return resolverInternal._openRedirect(userInternal.auth, provider, \\\"reauthViaRedirect\\\" /* REAUTH_VIA_REDIRECT */, eventId);\\r\\n}\\r\\n/**\\r\\n * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using some other provider.\\r\\n * const result = await signInWithEmailAndPassword(auth, email, password);\\r\\n * // Link using a redirect.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * await linkWithRedirect(result.user, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * ```\\r\\n *\\r\\n * @param user - The user.\\r\\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\\r\\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction linkWithRedirect(user, provider, resolver) {\\r\\n    return _linkWithRedirect(user, provider, resolver);\\r\\n}\\r\\nasync function _linkWithRedirect(user, provider, resolver) {\\r\\n    const userInternal = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(user);\\r\\n    _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\\r\\n    // Allow the resolver to error before persisting the redirect user\\r\\n    const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\\r\\n    await _assertLinkedStatus(false, userInternal, provider.providerId);\\r\\n    await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\\r\\n    const eventId = await prepareUserForRedirect(userInternal);\\r\\n    return resolverInternal._openRedirect(userInternal.auth, provider, \\\"linkViaRedirect\\\" /* LINK_VIA_REDIRECT */, eventId);\\r\\n}\\r\\n/**\\r\\n * Returns a {@link UserCredential} from the redirect-based sign-in flow.\\r\\n *\\r\\n * @remarks\\r\\n * If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an\\r\\n * error. If no redirect operation was called, returns a {@link UserCredential}\\r\\n * with a null `user`.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Sign in using a redirect.\\r\\n * const provider = new FacebookAuthProvider();\\r\\n * // You can add additional scopes to the provider:\\r\\n * provider.addScope('user_birthday');\\r\\n * // Start a sign in process for an unauthenticated user.\\r\\n * await signInWithRedirect(auth, provider);\\r\\n * // This will trigger a full page redirect away from your app\\r\\n *\\r\\n * // After returning from the redirect when your app initializes you can obtain the result\\r\\n * const result = await getRedirectResult(auth);\\r\\n * if (result) {\\r\\n *   // This is the signed-in user\\r\\n *   const user = result.user;\\r\\n *   // This gives you a Facebook Access Token.\\r\\n *   const credential = provider.credentialFromResult(auth, result);\\r\\n *   const token = credential.accessToken;\\r\\n * }\\r\\n * // As this API can be used for sign-in, linking and reauthentication,\\r\\n * // check the operationType to determine what triggered this redirect\\r\\n * // operation.\\r\\n * const operationType = result.operationType;\\r\\n * ```\\r\\n *\\r\\n * @param auth - The {@link Auth} instance.\\r\\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\\r\\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function getRedirectResult(auth, resolver) {\\r\\n    await _castAuth(auth)._initializationPromise;\\r\\n    return _getRedirectResult(auth, resolver, false);\\r\\n}\\r\\nasync function _getRedirectResult(auth, resolverExtern, bypassAuthState = false) {\\r\\n    const authInternal = _castAuth(auth);\\r\\n    const resolver = _withDefaultResolver(authInternal, resolverExtern);\\r\\n    const action = new RedirectAction(authInternal, resolver, bypassAuthState);\\r\\n    const result = await action.execute();\\r\\n    if (result && !bypassAuthState) {\\r\\n        delete result.user._redirectEventId;\\r\\n        await authInternal._persistUserIfCurrent(result.user);\\r\\n        await authInternal._setRedirectUser(null, resolverExtern);\\r\\n    }\\r\\n    return result;\\r\\n}\\r\\nasync function prepareUserForRedirect(user) {\\r\\n    const eventId = _generateEventId(`${user.uid}:::`);\\r\\n    user._redirectEventId = eventId;\\r\\n    await user.auth._setRedirectUser(user);\\r\\n    await user.auth._persistUserIfCurrent(user);\\r\\n    return eventId;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// The amount of time to store the UIDs of seen events; this is\\r\\n// set to 10 min by default\\r\\nconst EVENT_DUPLICATION_CACHE_DURATION_MS = 10 * 60 * 1000;\\r\\nclass AuthEventManager {\\r\\n    constructor(auth) {\\r\\n        this.auth = auth;\\r\\n        this.cachedEventUids = new Set();\\r\\n        this.consumers = new Set();\\r\\n        this.queuedRedirectEvent = null;\\r\\n        this.hasHandledPotentialRedirect = false;\\r\\n        this.lastProcessedEventTime = Date.now();\\r\\n    }\\r\\n    registerConsumer(authEventConsumer) {\\r\\n        this.consumers.add(authEventConsumer);\\r\\n        if (this.queuedRedirectEvent &&\\r\\n            this.isEventForConsumer(this.queuedRedirectEvent, authEventConsumer)) {\\r\\n            this.sendToConsumer(this.queuedRedirectEvent, authEventConsumer);\\r\\n            this.saveEventToCache(this.queuedRedirectEvent);\\r\\n            this.queuedRedirectEvent = null;\\r\\n        }\\r\\n    }\\r\\n    unregisterConsumer(authEventConsumer) {\\r\\n        this.consumers.delete(authEventConsumer);\\r\\n    }\\r\\n    onEvent(event) {\\r\\n        // Check if the event has already been handled\\r\\n        if (this.hasEventBeenHandled(event)) {\\r\\n            return false;\\r\\n        }\\r\\n        let handled = false;\\r\\n        this.consumers.forEach(consumer => {\\r\\n            if (this.isEventForConsumer(event, consumer)) {\\r\\n                handled = true;\\r\\n                this.sendToConsumer(event, consumer);\\r\\n                this.saveEventToCache(event);\\r\\n            }\\r\\n        });\\r\\n        if (this.hasHandledPotentialRedirect || !isRedirectEvent(event)) {\\r\\n            // If we've already seen a redirect before, or this is a popup event,\\r\\n            // bail now\\r\\n            return handled;\\r\\n        }\\r\\n        this.hasHandledPotentialRedirect = true;\\r\\n        // If the redirect wasn't handled, hang on to it\\r\\n        if (!handled) {\\r\\n            this.queuedRedirectEvent = event;\\r\\n            handled = true;\\r\\n        }\\r\\n        return handled;\\r\\n    }\\r\\n    sendToConsumer(event, consumer) {\\r\\n        var _a;\\r\\n        if (event.error && !isNullRedirectEvent(event)) {\\r\\n            const code = ((_a = event.error.code) === null || _a === void 0 ? void 0 : _a.split('auth/')[1]) ||\\r\\n                \\\"internal-error\\\" /* INTERNAL_ERROR */;\\r\\n            consumer.onError(_createError(this.auth, code));\\r\\n        }\\r\\n        else {\\r\\n            consumer.onAuthEvent(event);\\r\\n        }\\r\\n    }\\r\\n    isEventForConsumer(event, consumer) {\\r\\n        const eventIdMatches = consumer.eventId === null ||\\r\\n            (!!event.eventId && event.eventId === consumer.eventId);\\r\\n        return consumer.filter.includes(event.type) && eventIdMatches;\\r\\n    }\\r\\n    hasEventBeenHandled(event) {\\r\\n        if (Date.now() - this.lastProcessedEventTime >=\\r\\n            EVENT_DUPLICATION_CACHE_DURATION_MS) {\\r\\n            this.cachedEventUids.clear();\\r\\n        }\\r\\n        return this.cachedEventUids.has(eventUid(event));\\r\\n    }\\r\\n    saveEventToCache(event) {\\r\\n        this.cachedEventUids.add(eventUid(event));\\r\\n        this.lastProcessedEventTime = Date.now();\\r\\n    }\\r\\n}\\r\\nfunction eventUid(e) {\\r\\n    return [e.type, e.eventId, e.sessionId, e.tenantId].filter(v => v).join('-');\\r\\n}\\r\\nfunction isNullRedirectEvent({ type, error }) {\\r\\n    return (type === \\\"unknown\\\" /* UNKNOWN */ &&\\r\\n        (error === null || error === void 0 ? void 0 : error.code) === `auth/${\\\"no-auth-event\\\" /* NO_AUTH_EVENT */}`);\\r\\n}\\r\\nfunction isRedirectEvent(event) {\\r\\n    switch (event.type) {\\r\\n        case \\\"signInViaRedirect\\\" /* SIGN_IN_VIA_REDIRECT */:\\r\\n        case \\\"linkViaRedirect\\\" /* LINK_VIA_REDIRECT */:\\r\\n        case \\\"reauthViaRedirect\\\" /* REAUTH_VIA_REDIRECT */:\\r\\n            return true;\\r\\n        case \\\"unknown\\\" /* UNKNOWN */:\\r\\n            return isNullRedirectEvent(event);\\r\\n        default:\\r\\n            return false;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nasync function _getProjectConfig(auth, request = {}) {\\r\\n    return _performApiRequest(auth, \\\"GET\\\" /* GET */, \\\"/v1/projects\\\" /* GET_PROJECT_CONFIG */, request);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst IP_ADDRESS_REGEX = /^\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}$/;\\r\\nconst HTTP_REGEX = /^https?/;\\r\\nasync function _validateOrigin(auth) {\\r\\n    // Skip origin validation if we are in an emulated environment\\r\\n    if (auth.config.emulator) {\\r\\n        return;\\r\\n    }\\r\\n    const { authorizedDomains } = await _getProjectConfig(auth);\\r\\n    for (const domain of authorizedDomains) {\\r\\n        try {\\r\\n            if (matchDomain(domain)) {\\r\\n                return;\\r\\n            }\\r\\n        }\\r\\n        catch (_a) {\\r\\n            // Do nothing if there's a URL error; just continue searching\\r\\n        }\\r\\n    }\\r\\n    // In the old SDK, this error also provides helpful messages.\\r\\n    _fail(auth, \\\"unauthorized-domain\\\" /* INVALID_ORIGIN */);\\r\\n}\\r\\nfunction matchDomain(expected) {\\r\\n    const currentUrl = _getCurrentUrl();\\r\\n    const { protocol, hostname } = new URL(currentUrl);\\r\\n    if (expected.startsWith('chrome-extension://')) {\\r\\n        const ceUrl = new URL(expected);\\r\\n        if (ceUrl.hostname === '' && hostname === '') {\\r\\n            // For some reason we're not parsing chrome URLs properly\\r\\n            return (protocol === 'chrome-extension:' &&\\r\\n                expected.replace('chrome-extension://', '') ===\\r\\n                    currentUrl.replace('chrome-extension://', ''));\\r\\n        }\\r\\n        return protocol === 'chrome-extension:' && ceUrl.hostname === hostname;\\r\\n    }\\r\\n    if (!HTTP_REGEX.test(protocol)) {\\r\\n        return false;\\r\\n    }\\r\\n    if (IP_ADDRESS_REGEX.test(expected)) {\\r\\n        // The domain has to be exactly equal to the pattern, as an IP domain will\\r\\n        // only contain the IP, no extra character.\\r\\n        return hostname === expected;\\r\\n    }\\r\\n    // Dots in pattern should be escaped.\\r\\n    const escapedDomainPattern = expected.replace(/\\\\./g, '\\\\\\\\.');\\r\\n    // Non ip address domains.\\r\\n    // domain.com = *.domain.com OR domain.com\\r\\n    const re = new RegExp('^(.+\\\\\\\\.' + escapedDomainPattern + '|' + escapedDomainPattern + ')$', 'i');\\r\\n    return re.test(hostname);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC.\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst NETWORK_TIMEOUT = new Delay(30000, 60000);\\r\\n/**\\r\\n * Reset unlaoded GApi modules. If gapi.load fails due to a network error,\\r\\n * it will stop working after a retrial. This is a hack to fix this issue.\\r\\n */\\r\\nfunction resetUnloadedGapiModules() {\\r\\n    // Clear last failed gapi.load state to force next gapi.load to first\\r\\n    // load the failed gapi.iframes module.\\r\\n    // Get gapix.beacon context.\\r\\n    const beacon = _window().___jsl;\\r\\n    // Get current hint.\\r\\n    if (beacon === null || beacon === void 0 ? void 0 : beacon.H) {\\r\\n        // Get gapi hint.\\r\\n        for (const hint of Object.keys(beacon.H)) {\\r\\n            // Requested modules.\\r\\n            beacon.H[hint].r = beacon.H[hint].r || [];\\r\\n            // Loaded modules.\\r\\n            beacon.H[hint].L = beacon.H[hint].L || [];\\r\\n            // Set requested modules to a copy of the loaded modules.\\r\\n            beacon.H[hint].r = [...beacon.H[hint].L];\\r\\n            // Clear pending callbacks.\\r\\n            if (beacon.CP) {\\r\\n                for (let i = 0; i < beacon.CP.length; i++) {\\r\\n                    // Remove all failed pending callbacks.\\r\\n                    beacon.CP[i] = null;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n}\\r\\nfunction loadGapi(auth) {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        var _a, _b, _c;\\r\\n        // Function to run when gapi.load is ready.\\r\\n        function loadGapiIframe() {\\r\\n            // The developer may have tried to previously run gapi.load and failed.\\r\\n            // Run this to fix that.\\r\\n            resetUnloadedGapiModules();\\r\\n            gapi.load('gapi.iframes', {\\r\\n                callback: () => {\\r\\n                    resolve(gapi.iframes.getContext());\\r\\n                },\\r\\n                ontimeout: () => {\\r\\n                    // The above reset may be sufficient, but having this reset after\\r\\n                    // failure ensures that if the developer calls gapi.load after the\\r\\n                    // connection is re-established and before another attempt to embed\\r\\n                    // the iframe, it would work and would not be broken because of our\\r\\n                    // failed attempt.\\r\\n                    // Timeout when gapi.iframes.Iframe not loaded.\\r\\n                    resetUnloadedGapiModules();\\r\\n                    reject(_createError(auth, \\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */));\\r\\n                },\\r\\n                timeout: NETWORK_TIMEOUT.get()\\r\\n            });\\r\\n        }\\r\\n        if ((_b = (_a = _window().gapi) === null || _a === void 0 ? void 0 : _a.iframes) === null || _b === void 0 ? void 0 : _b.Iframe) {\\r\\n            // If gapi.iframes.Iframe available, resolve.\\r\\n            resolve(gapi.iframes.getContext());\\r\\n        }\\r\\n        else if (!!((_c = _window().gapi) === null || _c === void 0 ? void 0 : _c.load)) {\\r\\n            // Gapi loader ready, load gapi.iframes.\\r\\n            loadGapiIframe();\\r\\n        }\\r\\n        else {\\r\\n            // Create a new iframe callback when this is called so as not to overwrite\\r\\n            // any previous defined callback. This happens if this method is called\\r\\n            // multiple times in parallel and could result in the later callback\\r\\n            // overwriting the previous one. This would end up with a iframe\\r\\n            // timeout.\\r\\n            const cbName = _generateCallbackName('iframefcb');\\r\\n            // GApi loader not available, dynamically load platform.js.\\r\\n            _window()[cbName] = () => {\\r\\n                // GApi loader should be ready.\\r\\n                if (!!gapi.load) {\\r\\n                    loadGapiIframe();\\r\\n                }\\r\\n                else {\\r\\n                    // Gapi loader failed, throw error.\\r\\n                    reject(_createError(auth, \\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */));\\r\\n                }\\r\\n            };\\r\\n            // Load GApi loader.\\r\\n            return _loadJS(`https://apis.google.com/js/api.js?onload=${cbName}`).catch(e => reject(e));\\r\\n        }\\r\\n    }).catch(error => {\\r\\n        // Reset cached promise to allow for retrial.\\r\\n        cachedGApiLoader = null;\\r\\n        throw error;\\r\\n    });\\r\\n}\\r\\nlet cachedGApiLoader = null;\\r\\nfunction _loadGapi(auth) {\\r\\n    cachedGApiLoader = cachedGApiLoader || loadGapi(auth);\\r\\n    return cachedGApiLoader;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC.\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst PING_TIMEOUT = new Delay(5000, 15000);\\r\\nconst IFRAME_PATH = '__/auth/iframe';\\r\\nconst EMULATED_IFRAME_PATH = 'emulator/auth/iframe';\\r\\nconst IFRAME_ATTRIBUTES = {\\r\\n    style: {\\r\\n        position: 'absolute',\\r\\n        top: '-100px',\\r\\n        width: '1px',\\r\\n        height: '1px'\\r\\n    },\\r\\n    'aria-hidden': 'true',\\r\\n    tabindex: '-1'\\r\\n};\\r\\n// Map from apiHost to endpoint ID for passing into iframe. In current SDK, apiHost can be set to\\r\\n// anything (not from a list of endpoints with IDs as in legacy), so this is the closest we can get.\\r\\nconst EID_FROM_APIHOST = new Map([\\r\\n    [\\\"identitytoolkit.googleapis.com\\\" /* API_HOST */, 'p'],\\r\\n    ['staging-identitytoolkit.sandbox.googleapis.com', 's'],\\r\\n    ['test-identitytoolkit.sandbox.googleapis.com', 't'] // test\\r\\n]);\\r\\nfunction getIframeUrl(auth) {\\r\\n    const config = auth.config;\\r\\n    _assert(config.authDomain, auth, \\\"auth-domain-config-required\\\" /* MISSING_AUTH_DOMAIN */);\\r\\n    const url = config.emulator\\r\\n        ? _emulatorUrl(config, EMULATED_IFRAME_PATH)\\r\\n        : `https://${auth.config.authDomain}/${IFRAME_PATH}`;\\r\\n    const params = {\\r\\n        apiKey: config.apiKey,\\r\\n        appName: auth.name,\\r\\n        v: _firebase_app__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION\\r\\n    };\\r\\n    const eid = EID_FROM_APIHOST.get(auth.config.apiHost);\\r\\n    if (eid) {\\r\\n        params.eid = eid;\\r\\n    }\\r\\n    const frameworks = auth._getFrameworks();\\r\\n    if (frameworks.length) {\\r\\n        params.fw = frameworks.join(',');\\r\\n    }\\r\\n    return `${url}?${(0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystring)(params).slice(1)}`;\\r\\n}\\r\\nasync function _openIframe(auth) {\\r\\n    const context = await _loadGapi(auth);\\r\\n    const gapi = _window().gapi;\\r\\n    _assert(gapi, auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n    return context.open({\\r\\n        where: document.body,\\r\\n        url: getIframeUrl(auth),\\r\\n        messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER,\\r\\n        attributes: IFRAME_ATTRIBUTES,\\r\\n        dontclear: true\\r\\n    }, (iframe) => new Promise(async (resolve, reject) => {\\r\\n        await iframe.restyle({\\r\\n            // Prevent iframe from closing on mouse out.\\r\\n            setHideOnLeave: false\\r\\n        });\\r\\n        const networkError = _createError(auth, \\\"network-request-failed\\\" /* NETWORK_REQUEST_FAILED */);\\r\\n        // Confirm iframe is correctly loaded.\\r\\n        // To fallback on failure, set a timeout.\\r\\n        const networkErrorTimer = _window().setTimeout(() => {\\r\\n            reject(networkError);\\r\\n        }, PING_TIMEOUT.get());\\r\\n        // Clear timer and resolve pending iframe ready promise.\\r\\n        function clearTimerAndResolve() {\\r\\n            _window().clearTimeout(networkErrorTimer);\\r\\n            resolve(iframe);\\r\\n        }\\r\\n        // This returns an IThenable. However the reject part does not call\\r\\n        // when the iframe is not loaded.\\r\\n        iframe.ping(clearTimerAndResolve).then(clearTimerAndResolve, () => {\\r\\n            reject(networkError);\\r\\n        });\\r\\n    }));\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC.\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst BASE_POPUP_OPTIONS = {\\r\\n    location: 'yes',\\r\\n    resizable: 'yes',\\r\\n    statusbar: 'yes',\\r\\n    toolbar: 'no'\\r\\n};\\r\\nconst DEFAULT_WIDTH = 500;\\r\\nconst DEFAULT_HEIGHT = 600;\\r\\nconst TARGET_BLANK = '_blank';\\r\\nconst FIREFOX_EMPTY_URL = 'http://localhost';\\r\\nclass AuthPopup {\\r\\n    constructor(window) {\\r\\n        this.window = window;\\r\\n        this.associatedEvent = null;\\r\\n    }\\r\\n    close() {\\r\\n        if (this.window) {\\r\\n            try {\\r\\n                this.window.close();\\r\\n            }\\r\\n            catch (e) { }\\r\\n        }\\r\\n    }\\r\\n}\\r\\nfunction _open(auth, url, name, width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT) {\\r\\n    const top = Math.max((window.screen.availHeight - height) / 2, 0).toString();\\r\\n    const left = Math.max((window.screen.availWidth - width) / 2, 0).toString();\\r\\n    let target = '';\\r\\n    const options = Object.assign(Object.assign({}, BASE_POPUP_OPTIONS), { width: width.toString(), height: height.toString(), top,\\r\\n        left });\\r\\n    // Chrome iOS 7 and 8 is returning an undefined popup win when target is\\r\\n    // specified, even though the popup is not necessarily blocked.\\r\\n    const ua = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getUA)().toLowerCase();\\r\\n    if (name) {\\r\\n        target = _isChromeIOS(ua) ? TARGET_BLANK : name;\\r\\n    }\\r\\n    if (_isFirefox(ua)) {\\r\\n        // Firefox complains when invalid URLs are popped out. Hacky way to bypass.\\r\\n        url = url || FIREFOX_EMPTY_URL;\\r\\n        // Firefox disables by default scrolling on popup windows, which can create\\r\\n        // issues when the user has many Google accounts, for instance.\\r\\n        options.scrollbars = 'yes';\\r\\n    }\\r\\n    const optionsString = Object.entries(options).reduce((accum, [key, value]) => `${accum}${key}=${value},`, '');\\r\\n    if (_isIOSStandalone(ua) && target !== '_self') {\\r\\n        openAsNewWindowIOS(url || '', target);\\r\\n        return new AuthPopup(null);\\r\\n    }\\r\\n    // about:blank getting sanitized causing browsers like IE/Edge to display\\r\\n    // brief error message before redirecting to handler.\\r\\n    const newWin = window.open(url || '', target, optionsString);\\r\\n    _assert(newWin, auth, \\\"popup-blocked\\\" /* POPUP_BLOCKED */);\\r\\n    // Flaky on IE edge, encapsulate with a try and catch.\\r\\n    try {\\r\\n        newWin.focus();\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return new AuthPopup(newWin);\\r\\n}\\r\\nfunction openAsNewWindowIOS(url, target) {\\r\\n    const el = document.createElement('a');\\r\\n    el.href = url;\\r\\n    el.target = target;\\r\\n    const click = document.createEvent('MouseEvent');\\r\\n    click.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 1, null);\\r\\n    el.dispatchEvent(click);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * URL for Authentication widget which will initiate the OAuth handshake\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst WIDGET_PATH = '__/auth/handler';\\r\\n/**\\r\\n * URL for emulated environment\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst EMULATOR_WIDGET_PATH = 'emulator/auth/handler';\\r\\nfunction _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) {\\r\\n    _assert(auth.config.authDomain, auth, \\\"auth-domain-config-required\\\" /* MISSING_AUTH_DOMAIN */);\\r\\n    _assert(auth.config.apiKey, auth, \\\"invalid-api-key\\\" /* INVALID_API_KEY */);\\r\\n    const params = {\\r\\n        apiKey: auth.config.apiKey,\\r\\n        appName: auth.name,\\r\\n        authType,\\r\\n        redirectUrl,\\r\\n        v: _firebase_app__WEBPACK_IMPORTED_MODULE_1__.SDK_VERSION,\\r\\n        eventId\\r\\n    };\\r\\n    if (provider instanceof FederatedAuthProvider) {\\r\\n        provider.setDefaultLanguage(auth.languageCode);\\r\\n        params.providerId = provider.providerId || '';\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.isEmpty)(provider.getCustomParameters())) {\\r\\n            params.customParameters = JSON.stringify(provider.getCustomParameters());\\r\\n        }\\r\\n        // TODO set additionalParams from the provider as well?\\r\\n        for (const [key, value] of Object.entries(additionalParams || {})) {\\r\\n            params[key] = value;\\r\\n        }\\r\\n    }\\r\\n    if (provider instanceof BaseOAuthProvider) {\\r\\n        const scopes = provider.getScopes().filter(scope => scope !== '');\\r\\n        if (scopes.length > 0) {\\r\\n            params.scopes = scopes.join(',');\\r\\n        }\\r\\n    }\\r\\n    if (auth.tenantId) {\\r\\n        params.tid = auth.tenantId;\\r\\n    }\\r\\n    // TODO: maybe set eid as endipointId\\r\\n    // TODO: maybe set fw as Frameworks.join(\\\",\\\")\\r\\n    const paramsDict = params;\\r\\n    for (const key of Object.keys(paramsDict)) {\\r\\n        if (paramsDict[key] === undefined) {\\r\\n            delete paramsDict[key];\\r\\n        }\\r\\n    }\\r\\n    return `${getHandlerBase(auth)}?${(0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.querystring)(paramsDict).slice(1)}`;\\r\\n}\\r\\nfunction getHandlerBase({ config }) {\\r\\n    if (!config.emulator) {\\r\\n        return `https://${config.authDomain}/${WIDGET_PATH}`;\\r\\n    }\\r\\n    return _emulatorUrl(config, EMULATOR_WIDGET_PATH);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The special web storage event\\r\\n *\\r\\n */\\r\\nconst WEB_STORAGE_SUPPORT_KEY = 'webStorageSupport';\\r\\nclass BrowserPopupRedirectResolver {\\r\\n    constructor() {\\r\\n        this.eventManagers = {};\\r\\n        this.iframes = {};\\r\\n        this.originValidationPromises = {};\\r\\n        this._redirectPersistence = browserSessionPersistence;\\r\\n        this._completeRedirectFn = _getRedirectResult;\\r\\n        this._overrideRedirectResult = _overrideRedirectResult;\\r\\n    }\\r\\n    // Wrapping in async even though we don't await anywhere in order\\r\\n    // to make sure errors are raised as promise rejections\\r\\n    async _openPopup(auth, provider, authType, eventId) {\\r\\n        var _a;\\r\\n        debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');\\r\\n        const url = _getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId);\\r\\n        return _open(auth, url, _generateEventId());\\r\\n    }\\r\\n    async _openRedirect(auth, provider, authType, eventId) {\\r\\n        await this._originValidation(auth);\\r\\n        _setWindowLocation(_getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId));\\r\\n        return new Promise(() => { });\\r\\n    }\\r\\n    _initialize(auth) {\\r\\n        const key = auth._key();\\r\\n        if (this.eventManagers[key]) {\\r\\n            const { manager, promise } = this.eventManagers[key];\\r\\n            if (manager) {\\r\\n                return Promise.resolve(manager);\\r\\n            }\\r\\n            else {\\r\\n                debugAssert(promise, 'If manager is not set, promise should be');\\r\\n                return promise;\\r\\n            }\\r\\n        }\\r\\n        const promise = this.initAndGetManager(auth);\\r\\n        this.eventManagers[key] = { promise };\\r\\n        // If the promise is rejected, the key should be removed so that the\\r\\n        // operation can be retried later.\\r\\n        promise.catch(() => {\\r\\n            delete this.eventManagers[key];\\r\\n        });\\r\\n        return promise;\\r\\n    }\\r\\n    async initAndGetManager(auth) {\\r\\n        const iframe = await _openIframe(auth);\\r\\n        const manager = new AuthEventManager(auth);\\r\\n        iframe.register('authEvent', (iframeEvent) => {\\r\\n            _assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, \\\"invalid-auth-event\\\" /* INVALID_AUTH_EVENT */);\\r\\n            // TODO: Consider splitting redirect and popup events earlier on\\r\\n            const handled = manager.onEvent(iframeEvent.authEvent);\\r\\n            return { status: handled ? \\\"ACK\\\" /* ACK */ : \\\"ERROR\\\" /* ERROR */ };\\r\\n        }, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);\\r\\n        this.eventManagers[auth._key()] = { manager };\\r\\n        this.iframes[auth._key()] = iframe;\\r\\n        return manager;\\r\\n    }\\r\\n    _isIframeWebStorageSupported(auth, cb) {\\r\\n        const iframe = this.iframes[auth._key()];\\r\\n        iframe.send(WEB_STORAGE_SUPPORT_KEY, { type: WEB_STORAGE_SUPPORT_KEY }, result => {\\r\\n            var _a;\\r\\n            const isSupported = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a[WEB_STORAGE_SUPPORT_KEY];\\r\\n            if (isSupported !== undefined) {\\r\\n                cb(!!isSupported);\\r\\n            }\\r\\n            _fail(auth, \\\"internal-error\\\" /* INTERNAL_ERROR */);\\r\\n        }, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);\\r\\n    }\\r\\n    _originValidation(auth) {\\r\\n        const key = auth._key();\\r\\n        if (!this.originValidationPromises[key]) {\\r\\n            this.originValidationPromises[key] = _validateOrigin(auth);\\r\\n        }\\r\\n        return this.originValidationPromises[key];\\r\\n    }\\r\\n    get _shouldInitProactively() {\\r\\n        // Mobile browsers and Safari need to optimistically initialize\\r\\n        return _isMobileBrowser() || _isSafari() || _isIOS();\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * An implementation of {@link PopupRedirectResolver} suitable for browser\\r\\n * based applications.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst browserPopupRedirectResolver = BrowserPopupRedirectResolver;\\n\\nclass MultiFactorAssertionImpl {\\r\\n    constructor(factorId) {\\r\\n        this.factorId = factorId;\\r\\n    }\\r\\n    _process(auth, session, displayName) {\\r\\n        switch (session.type) {\\r\\n            case \\\"enroll\\\" /* ENROLL */:\\r\\n                return this._finalizeEnroll(auth, session.credential, displayName);\\r\\n            case \\\"signin\\\" /* SIGN_IN */:\\r\\n                return this._finalizeSignIn(auth, session.credential);\\r\\n            default:\\r\\n                return debugFail('unexpected MultiFactorSessionType');\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * {@inheritdoc PhoneMultiFactorAssertion}\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass PhoneMultiFactorAssertionImpl extends MultiFactorAssertionImpl {\\r\\n    constructor(credential) {\\r\\n        super(\\\"phone\\\" /* PHONE */);\\r\\n        this.credential = credential;\\r\\n    }\\r\\n    /** @internal */\\r\\n    static _fromCredential(credential) {\\r\\n        return new PhoneMultiFactorAssertionImpl(credential);\\r\\n    }\\r\\n    /** @internal */\\r\\n    _finalizeEnroll(auth, idToken, displayName) {\\r\\n        return finalizeEnrollPhoneMfa(auth, {\\r\\n            idToken,\\r\\n            displayName,\\r\\n            phoneVerificationInfo: this.credential._makeVerificationRequest()\\r\\n        });\\r\\n    }\\r\\n    /** @internal */\\r\\n    _finalizeSignIn(auth, mfaPendingCredential) {\\r\\n        return finalizeSignInPhoneMfa(auth, {\\r\\n            mfaPendingCredential,\\r\\n            phoneVerificationInfo: this.credential._makeVerificationRequest()\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Provider for generating a {@link PhoneMultiFactorAssertion}.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nclass PhoneMultiFactorGenerator {\\r\\n    constructor() { }\\r\\n    /**\\r\\n     * Provides a {@link PhoneMultiFactorAssertion} to confirm ownership of the phone second factor.\\r\\n     *\\r\\n     * @param phoneAuthCredential - A credential provided by {@link PhoneAuthProvider.credential}.\\r\\n     * @returns A {@link PhoneMultiFactorAssertion} which can be used with\\r\\n     * {@link MultiFactorResolver.resolveSignIn}\\r\\n     */\\r\\n    static assertion(credential) {\\r\\n        return PhoneMultiFactorAssertionImpl._fromCredential(credential);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * The identifier of the phone second factor: `phone`.\\r\\n */\\r\\nPhoneMultiFactorGenerator.FACTOR_ID = 'phone';\\n\\nvar name = \\\"@firebase/auth\\\";\\nvar version = \\\"0.20.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass AuthInterop {\\r\\n    constructor(auth) {\\r\\n        this.auth = auth;\\r\\n        this.internalListeners = new Map();\\r\\n    }\\r\\n    getUid() {\\r\\n        var _a;\\r\\n        this.assertAuthConfigured();\\r\\n        return ((_a = this.auth.currentUser) === null || _a === void 0 ? void 0 : _a.uid) || null;\\r\\n    }\\r\\n    async getToken(forceRefresh) {\\r\\n        this.assertAuthConfigured();\\r\\n        await this.auth._initializationPromise;\\r\\n        if (!this.auth.currentUser) {\\r\\n            return null;\\r\\n        }\\r\\n        const accessToken = await this.auth.currentUser.getIdToken(forceRefresh);\\r\\n        return { accessToken };\\r\\n    }\\r\\n    addAuthTokenListener(listener) {\\r\\n        this.assertAuthConfigured();\\r\\n        if (this.internalListeners.has(listener)) {\\r\\n            return;\\r\\n        }\\r\\n        const unsubscribe = this.auth.onIdTokenChanged(user => {\\r\\n            var _a;\\r\\n            listener(((_a = user) === null || _a === void 0 ? void 0 : _a.stsTokenManager.accessToken) || null);\\r\\n        });\\r\\n        this.internalListeners.set(listener, unsubscribe);\\r\\n        this.updateProactiveRefresh();\\r\\n    }\\r\\n    removeAuthTokenListener(listener) {\\r\\n        this.assertAuthConfigured();\\r\\n        const unsubscribe = this.internalListeners.get(listener);\\r\\n        if (!unsubscribe) {\\r\\n            return;\\r\\n        }\\r\\n        this.internalListeners.delete(listener);\\r\\n        unsubscribe();\\r\\n        this.updateProactiveRefresh();\\r\\n    }\\r\\n    assertAuthConfigured() {\\r\\n        _assert(this.auth._initializationPromise, \\\"dependent-sdk-initialized-before-auth\\\" /* DEPENDENT_SDK_INIT_BEFORE_AUTH */);\\r\\n    }\\r\\n    updateProactiveRefresh() {\\r\\n        if (this.internalListeners.size > 0) {\\r\\n            this.auth._startProactiveRefresh();\\r\\n        }\\r\\n        else {\\r\\n            this.auth._stopProactiveRefresh();\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getVersionForPlatform(clientPlatform) {\\r\\n    switch (clientPlatform) {\\r\\n        case \\\"Node\\\" /* NODE */:\\r\\n            return 'node';\\r\\n        case \\\"ReactNative\\\" /* REACT_NATIVE */:\\r\\n            return 'rn';\\r\\n        case \\\"Worker\\\" /* WORKER */:\\r\\n            return 'webworker';\\r\\n        case \\\"Cordova\\\" /* CORDOVA */:\\r\\n            return 'cordova';\\r\\n        default:\\r\\n            return undefined;\\r\\n    }\\r\\n}\\r\\n/** @internal */\\r\\nfunction registerAuth(clientPlatform) {\\r\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_3__.Component(\\\"auth\\\" /* AUTH */, (container, { options: deps }) => {\\r\\n        const app = container.getProvider('app').getImmediate();\\r\\n        const heartbeatServiceProvider = container.getProvider('heartbeat');\\r\\n        const { apiKey, authDomain } = app.options;\\r\\n        return ((app, heartbeatServiceProvider) => {\\r\\n            _assert(apiKey && !apiKey.includes(':'), \\\"invalid-api-key\\\" /* INVALID_API_KEY */, { appName: app.name });\\r\\n            // Auth domain is optional if IdP sign in isn't being used\\r\\n            _assert(!(authDomain === null || authDomain === void 0 ? void 0 : authDomain.includes(':')), \\\"argument-error\\\" /* ARGUMENT_ERROR */, {\\r\\n                appName: app.name\\r\\n            });\\r\\n            const config = {\\r\\n                apiKey,\\r\\n                authDomain,\\r\\n                clientPlatform,\\r\\n                apiHost: \\\"identitytoolkit.googleapis.com\\\" /* API_HOST */,\\r\\n                tokenApiHost: \\\"securetoken.googleapis.com\\\" /* TOKEN_API_HOST */,\\r\\n                apiScheme: \\\"https\\\" /* API_SCHEME */,\\r\\n                sdkClientVersion: _getClientVersion(clientPlatform)\\r\\n            };\\r\\n            const authInstance = new AuthImpl(app, heartbeatServiceProvider, config);\\r\\n            _initializeAuthInstance(authInstance, deps);\\r\\n            return authInstance;\\r\\n        })(app, heartbeatServiceProvider);\\r\\n    }, \\\"PUBLIC\\\" /* PUBLIC */)\\r\\n        /**\\r\\n         * Auth can only be initialized by explicitly calling getAuth() or initializeAuth()\\r\\n         * For why we do this, See go/firebase-next-auth-init\\r\\n         */\\r\\n        .setInstantiationMode(\\\"EXPLICIT\\\" /* EXPLICIT */)\\r\\n        /**\\r\\n         * Because all firebase products that depend on auth depend on auth-internal directly,\\r\\n         * we need to initialize auth-internal after auth is initialized to make it available to other firebase products.\\r\\n         */\\r\\n        .setInstanceCreatedCallback((container, _instanceIdentifier, _instance) => {\\r\\n        const authInternalProvider = container.getProvider(\\\"auth-internal\\\" /* AUTH_INTERNAL */);\\r\\n        authInternalProvider.initialize();\\r\\n    }));\\r\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_3__.Component(\\\"auth-internal\\\" /* AUTH_INTERNAL */, container => {\\r\\n        const auth = _castAuth(container.getProvider(\\\"auth\\\" /* AUTH */).getImmediate());\\r\\n        return (auth => new AuthInterop(auth))(auth);\\r\\n    }, \\\"PRIVATE\\\" /* PRIVATE */).setInstantiationMode(\\\"EXPLICIT\\\" /* EXPLICIT */));\\r\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__.registerVersion)(name, version, getVersionForPlatform(clientPlatform));\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__.registerVersion)(name, version, 'esm2017');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns the Auth instance associated with the provided {@link @firebase/app#FirebaseApp}.\\r\\n * If no instance exists, initializes an Auth instance with platform-specific default dependencies.\\r\\n *\\r\\n * @param app - The Firebase App.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getAuth(app = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__.getApp)()) {\\r\\n    const provider = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_1__._getProvider)(app, 'auth');\\r\\n    if (provider.isInitialized()) {\\r\\n        return provider.getImmediate();\\r\\n    }\\r\\n    return initializeAuth(app, {\\r\\n        popupRedirectResolver: browserPopupRedirectResolver,\\r\\n        persistence: [\\r\\n            indexedDBLocalPersistence,\\r\\n            browserLocalPersistence,\\r\\n            browserSessionPersistence\\r\\n        ]\\r\\n    });\\r\\n}\\r\\nregisterAuth(\\\"Browser\\\" /* BROWSER */);\\n\\n\\n//# sourceMappingURL=index-3b632d0b.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/auth/dist/esm2017/index-3b632d0b.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/auth/dist/esm2017/index.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/auth/dist/esm2017/index.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ActionCodeOperation\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.A),\\n/* harmony export */   \\\"ActionCodeURL\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ad),\\n/* harmony export */   \\\"AuthCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.H),\\n/* harmony export */   \\\"AuthErrorCodes\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.D),\\n/* harmony export */   \\\"EmailAuthCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.I),\\n/* harmony export */   \\\"EmailAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.M),\\n/* harmony export */   \\\"FacebookAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.N),\\n/* harmony export */   \\\"FactorId\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.F),\\n/* harmony export */   \\\"GithubAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.T),\\n/* harmony export */   \\\"GoogleAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.Q),\\n/* harmony export */   \\\"OAuthCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.J),\\n/* harmony export */   \\\"OAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.U),\\n/* harmony export */   \\\"OperationType\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.O),\\n/* harmony export */   \\\"PhoneAuthCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.K),\\n/* harmony export */   \\\"PhoneAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.P),\\n/* harmony export */   \\\"PhoneMultiFactorGenerator\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.m),\\n/* harmony export */   \\\"ProviderId\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.o),\\n/* harmony export */   \\\"RecaptchaVerifier\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.R),\\n/* harmony export */   \\\"SAMLAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.V),\\n/* harmony export */   \\\"SignInMethod\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.S),\\n/* harmony export */   \\\"TwitterAuthProvider\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.W),\\n/* harmony export */   \\\"applyActionCode\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a2),\\n/* harmony export */   \\\"beforeAuthStateChanged\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.t),\\n/* harmony export */   \\\"browserLocalPersistence\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.b),\\n/* harmony export */   \\\"browserPopupRedirectResolver\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.k),\\n/* harmony export */   \\\"browserSessionPersistence\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a),\\n/* harmony export */   \\\"checkActionCode\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a3),\\n/* harmony export */   \\\"confirmPasswordReset\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a1),\\n/* harmony export */   \\\"connectAuthEmulator\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.G),\\n/* harmony export */   \\\"createUserWithEmailAndPassword\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a5),\\n/* harmony export */   \\\"debugErrorMap\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.B),\\n/* harmony export */   \\\"deleteUser\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.z),\\n/* harmony export */   \\\"fetchSignInMethodsForEmail\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.aa),\\n/* harmony export */   \\\"getAdditionalUserInfo\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.al),\\n/* harmony export */   \\\"getAuth\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.n),\\n/* harmony export */   \\\"getIdToken\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ai),\\n/* harmony export */   \\\"getIdTokenResult\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.aj),\\n/* harmony export */   \\\"getMultiFactorResolver\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.an),\\n/* harmony export */   \\\"getRedirectResult\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.j),\\n/* harmony export */   \\\"inMemoryPersistence\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.L),\\n/* harmony export */   \\\"indexedDBLocalPersistence\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.i),\\n/* harmony export */   \\\"initializeAuth\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.E),\\n/* harmony export */   \\\"isSignInWithEmailLink\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a8),\\n/* harmony export */   \\\"linkWithCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.Z),\\n/* harmony export */   \\\"linkWithPhoneNumber\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.l),\\n/* harmony export */   \\\"linkWithPopup\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.d),\\n/* harmony export */   \\\"linkWithRedirect\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.g),\\n/* harmony export */   \\\"multiFactor\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ao),\\n/* harmony export */   \\\"onAuthStateChanged\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.v),\\n/* harmony export */   \\\"onIdTokenChanged\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.q),\\n/* harmony export */   \\\"parseActionCodeURL\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ae),\\n/* harmony export */   \\\"prodErrorMap\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.C),\\n/* harmony export */   \\\"reauthenticateWithCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__._),\\n/* harmony export */   \\\"reauthenticateWithPhoneNumber\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.r),\\n/* harmony export */   \\\"reauthenticateWithPopup\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.e),\\n/* harmony export */   \\\"reauthenticateWithRedirect\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.h),\\n/* harmony export */   \\\"reload\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.am),\\n/* harmony export */   \\\"sendEmailVerification\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ab),\\n/* harmony export */   \\\"sendPasswordResetEmail\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a0),\\n/* harmony export */   \\\"sendSignInLinkToEmail\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a7),\\n/* harmony export */   \\\"setPersistence\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.p),\\n/* harmony export */   \\\"signInAnonymously\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.X),\\n/* harmony export */   \\\"signInWithCredential\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.Y),\\n/* harmony export */   \\\"signInWithCustomToken\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.$),\\n/* harmony export */   \\\"signInWithEmailAndPassword\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a6),\\n/* harmony export */   \\\"signInWithEmailLink\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a9),\\n/* harmony export */   \\\"signInWithPhoneNumber\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.s),\\n/* harmony export */   \\\"signInWithPopup\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.c),\\n/* harmony export */   \\\"signInWithRedirect\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.f),\\n/* harmony export */   \\\"signOut\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.y),\\n/* harmony export */   \\\"unlink\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ak),\\n/* harmony export */   \\\"updateCurrentUser\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.x),\\n/* harmony export */   \\\"updateEmail\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ag),\\n/* harmony export */   \\\"updatePassword\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ah),\\n/* harmony export */   \\\"updatePhoneNumber\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"updateProfile\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.af),\\n/* harmony export */   \\\"useDeviceLanguage\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"verifyBeforeUpdateEmail\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.ac),\\n/* harmony export */   \\\"verifyPasswordResetCode\\\": () => (/* reexport safe */ _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__.a4)\\n/* harmony export */ });\\n/* harmony import */ var _index_3b632d0b_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index-3b632d0b.js */ \\\"./node_modules/@firebase/auth/dist/esm2017/index-3b632d0b.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\n//# sourceMappingURL=index.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/auth/dist/esm2017/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/firestore/dist/index.esm2017.js\":\n/*!****************************************************************!*\\\n  !*** ./node_modules/@firebase/firestore/dist/index.esm2017.js ***!\n  \\****************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* binding */ Jh),\\n/* harmony export */   \\\"Bytes\\\": () => (/* binding */ Qc),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* binding */ Pc),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* binding */ gc),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* binding */ wc),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* binding */ Rh),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* binding */ Kc),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* binding */ jc),\\n/* harmony export */   \\\"Firestore\\\": () => (/* binding */ Vc),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* binding */ Q),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* binding */ Wc),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* binding */ bc),\\n/* harmony export */   \\\"Query\\\": () => (/* binding */ mc),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* binding */ Dh),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* binding */ bh),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* binding */ Ph),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* binding */ Ah),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* binding */ at),\\n/* harmony export */   \\\"Transaction\\\": () => (/* binding */ ml),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* binding */ Zh),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* binding */ vt),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* binding */ xt),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* binding */ et),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* binding */ z),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* binding */ mt),\\n/* harmony export */   \\\"_cast\\\": () => (/* binding */ hc),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* binding */ q),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* binding */ yt),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* binding */ $),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* binding */ Rl),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* binding */ oc),\\n/* harmony export */   \\\"addDoc\\\": () => (/* binding */ ll),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* binding */ Tl),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* binding */ Il),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* binding */ Mc),\\n/* harmony export */   \\\"collection\\\": () => (/* binding */ yc),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* binding */ pc),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* binding */ _c),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* binding */ hl),\\n/* harmony export */   \\\"deleteField\\\": () => (/* binding */ yl),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* binding */ $c),\\n/* harmony export */   \\\"doc\\\": () => (/* binding */ Ic),\\n/* harmony export */   \\\"documentId\\\": () => (/* binding */ Gc),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* binding */ xc),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* binding */ Nc),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* binding */ Fc),\\n/* harmony export */   \\\"endAt\\\": () => (/* binding */ Gh),\\n/* harmony export */   \\\"endBefore\\\": () => (/* binding */ Kh),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* binding */ Dc),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* binding */ _l),\\n/* harmony export */   \\\"getDoc\\\": () => (/* binding */ el),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* binding */ sl),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* binding */ il),\\n/* harmony export */   \\\"getDocs\\\": () => (/* binding */ rl),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* binding */ ol),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* binding */ ul),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* binding */ Sc),\\n/* harmony export */   \\\"increment\\\": () => (/* binding */ El),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* binding */ vc),\\n/* harmony export */   \\\"limit\\\": () => (/* binding */ Fh),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* binding */ $h),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* binding */ Lc),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* binding */ Uc),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* binding */ fl),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* binding */ dl),\\n/* harmony export */   \\\"orderBy\\\": () => (/* binding */ Mh),\\n/* harmony export */   \\\"query\\\": () => (/* binding */ Ch),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* binding */ Ec),\\n/* harmony export */   \\\"refEqual\\\": () => (/* binding */ Tc),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* binding */ gl),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* binding */ pl),\\n/* harmony export */   \\\"setDoc\\\": () => (/* binding */ al),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ M),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* binding */ vh),\\n/* harmony export */   \\\"startAfter\\\": () => (/* binding */ Uh),\\n/* harmony export */   \\\"startAt\\\": () => (/* binding */ Lh),\\n/* harmony export */   \\\"terminate\\\": () => (/* binding */ Bc),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* binding */ cl),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* binding */ Oc),\\n/* harmony export */   \\\"where\\\": () => (/* binding */ Nh),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* binding */ Al)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @firebase/webchannel-wrapper */ \\\"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\\\");\\n\\n\\n\\n\\n\\n\\nconst D = \\\"@firebase/firestore\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Simple wrapper around a nullable UID. Mostly exists to make code more\\n * readable.\\n */\\nclass C {\\n    constructor(t) {\\n        this.uid = t;\\n    }\\n    isAuthenticated() {\\n        return null != this.uid;\\n    }\\n    /**\\n     * Returns a key representing this user, suitable for inclusion in a\\n     * dictionary.\\n     */    toKey() {\\n        return this.isAuthenticated() ? \\\"uid:\\\" + this.uid : \\\"anonymous-user\\\";\\n    }\\n    isEqual(t) {\\n        return t.uid === this.uid;\\n    }\\n}\\n\\n/** A user with a null UID. */ C.UNAUTHENTICATED = new C(null), \\n// TODO(mikelehen): Look into getting a proper uid-equivalent for\\n// non-FirebaseAuth providers.\\nC.GOOGLE_CREDENTIALS = new C(\\\"google-credentials-uid\\\"), C.FIRST_PARTY = new C(\\\"first-party-uid\\\"), \\nC.MOCK_USER = new C(\\\"mock-user\\\");\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nlet x = \\\"9.8.0\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst N = new _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.Logger(\\\"@firebase/firestore\\\");\\n\\n// Helper methods are needed because variables can't be exported as read/write\\nfunction k() {\\n    return N.logLevel;\\n}\\n\\n/**\\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\\n *\\n * @param logLevel - The verbosity you set for activity and error logging. Can\\n *   be any of the following values:\\n *\\n *   <ul>\\n *     <li>`debug` for the most verbose logging level, primarily for\\n *     debugging.</li>\\n *     <li>`error` to log errors only.</li>\\n *     <li><code>`silent` to turn off logging.</li>\\n *   </ul>\\n */ function M(t) {\\n    N.setLogLevel(t);\\n}\\n\\nfunction O(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n        const n = e.map(B);\\n        N.debug(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\nfunction F(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.ERROR) {\\n        const n = e.map(B);\\n        N.error(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * @internal\\n */ function $(t, ...e) {\\n    if (N.logLevel <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.WARN) {\\n        const n = e.map(B);\\n        N.warn(`Firestore (${x}): ${t}`, ...n);\\n    }\\n}\\n\\n/**\\n * Converts an additional log parameter to a string representation.\\n */ function B(t) {\\n    if (\\\"string\\\" == typeof t) return t;\\n    try {\\n        return e = t, JSON.stringify(e);\\n    } catch (e) {\\n        // Converting to JSON failed, just log the object directly\\n        return t;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /** Formats an object as a JSON string, suitable for logging. */\\n    var e;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Unconditionally fails, throwing an Error with the given message.\\n * Messages are stripped in production builds.\\n *\\n * Returns `never` and can be used in expressions:\\n * @example\\n * let futureVar = fail('not implemented yet');\\n */ function L(t = \\\"Unexpected state\\\") {\\n    // Log the failure in addition to throw an exception, just in case the\\n    // exception is swallowed.\\n    const e = `FIRESTORE (${x}) INTERNAL ASSERTION FAILED: ` + t;\\n    // NOTE: We don't use FirestoreError here because these are internal failures\\n    // that cannot be handled by the user. (Also it would create a circular\\n    // dependency between the error and assert modules which doesn't work.)\\n    throw F(e), new Error(e);\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * Messages are stripped in production builds.\\n */ function U(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Fails if the given assertion condition is false, throwing an Error with the\\n * given message if it did.\\n *\\n * The code of callsites invoking this function are stripped out in production\\n * builds. Any side-effects of code within the debugAssert() invocation will not\\n * happen in this case.\\n *\\n * @internal\\n */ function q(t, e) {\\n    t || L();\\n}\\n\\n/**\\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\\n * instance of `T` before casting.\\n */ function K(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const G = {\\n    // Causes are copied from:\\n    // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n    /** Not an error; returned on success. */\\n    OK: \\\"ok\\\",\\n    /** The operation was cancelled (typically by the caller). */\\n    CANCELLED: \\\"cancelled\\\",\\n    /** Unknown error or an error from a different error domain. */\\n    UNKNOWN: \\\"unknown\\\",\\n    /**\\n     * Client specified an invalid argument. Note that this differs from\\n     * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\\n     * problematic regardless of the state of the system (e.g., a malformed file\\n     * name).\\n     */\\n    INVALID_ARGUMENT: \\\"invalid-argument\\\",\\n    /**\\n     * Deadline expired before operation could complete. For operations that\\n     * change the state of the system, this error may be returned even if the\\n     * operation has completed successfully. For example, a successful response\\n     * from a server could have been delayed long enough for the deadline to\\n     * expire.\\n     */\\n    DEADLINE_EXCEEDED: \\\"deadline-exceeded\\\",\\n    /** Some requested entity (e.g., file or directory) was not found. */\\n    NOT_FOUND: \\\"not-found\\\",\\n    /**\\n     * Some entity that we attempted to create (e.g., file or directory) already\\n     * exists.\\n     */\\n    ALREADY_EXISTS: \\\"already-exists\\\",\\n    /**\\n     * The caller does not have permission to execute the specified operation.\\n     * PERMISSION_DENIED must not be used for rejections caused by exhausting\\n     * some resource (use RESOURCE_EXHAUSTED instead for those errors).\\n     * PERMISSION_DENIED must not be used if the caller can not be identified\\n     * (use UNAUTHENTICATED instead for those errors).\\n     */\\n    PERMISSION_DENIED: \\\"permission-denied\\\",\\n    /**\\n     * The request does not have valid authentication credentials for the\\n     * operation.\\n     */\\n    UNAUTHENTICATED: \\\"unauthenticated\\\",\\n    /**\\n     * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\\n     * entire file system is out of space.\\n     */\\n    RESOURCE_EXHAUSTED: \\\"resource-exhausted\\\",\\n    /**\\n     * Operation was rejected because the system is not in a state required for\\n     * the operation's execution. For example, directory to be deleted may be\\n     * non-empty, an rmdir operation is applied to a non-directory, etc.\\n     *\\n     * A litmus test that may help a service implementor in deciding\\n     * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\\n     *  (a) Use UNAVAILABLE if the client can retry just the failing call.\\n     *  (b) Use ABORTED if the client should retry at a higher-level\\n     *      (e.g., restarting a read-modify-write sequence).\\n     *  (c) Use FAILED_PRECONDITION if the client should not retry until\\n     *      the system state has been explicitly fixed. E.g., if an \\\"rmdir\\\"\\n     *      fails because the directory is non-empty, FAILED_PRECONDITION\\n     *      should be returned since the client should not retry unless\\n     *      they have first fixed up the directory by deleting files from it.\\n     *  (d) Use FAILED_PRECONDITION if the client performs conditional\\n     *      REST Get/Update/Delete on a resource and the resource on the\\n     *      server does not match the condition. E.g., conflicting\\n     *      read-modify-write on the same resource.\\n     */\\n    FAILED_PRECONDITION: \\\"failed-precondition\\\",\\n    /**\\n     * The operation was aborted, typically due to a concurrency issue like\\n     * sequencer check failures, transaction aborts, etc.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    ABORTED: \\\"aborted\\\",\\n    /**\\n     * Operation was attempted past the valid range. E.g., seeking or reading\\n     * past end of file.\\n     *\\n     * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\\n     * if the system state changes. For example, a 32-bit file system will\\n     * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\\n     * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\\n     * an offset past the current file size.\\n     *\\n     * There is a fair bit of overlap between FAILED_PRECONDITION and\\n     * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\\n     * when it applies so that callers who are iterating through a space can\\n     * easily look for an OUT_OF_RANGE error to detect when they are done.\\n     */\\n    OUT_OF_RANGE: \\\"out-of-range\\\",\\n    /** Operation is not implemented or not supported/enabled in this service. */\\n    UNIMPLEMENTED: \\\"unimplemented\\\",\\n    /**\\n     * Internal errors. Means some invariants expected by underlying System has\\n     * been broken. If you see one of these errors, Something is very broken.\\n     */\\n    INTERNAL: \\\"internal\\\",\\n    /**\\n     * The service is currently unavailable. This is a most likely a transient\\n     * condition and may be corrected by retrying with a backoff.\\n     *\\n     * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\\n     * and UNAVAILABLE.\\n     */\\n    UNAVAILABLE: \\\"unavailable\\\",\\n    /** Unrecoverable data loss or corruption. */\\n    DATA_LOSS: \\\"data-loss\\\"\\n};\\n\\n/** An error returned by a Firestore operation. */ class Q extends _firebase_util__WEBPACK_IMPORTED_MODULE_3__.FirebaseError {\\n    /** @hideconstructor */\\n    constructor(\\n    /**\\n     * The backend error code associated with this error.\\n     */\\n    t, \\n    /**\\n     * A custom error description.\\n     */\\n    e) {\\n        super(t, e), this.code = t, this.message = e, \\n        // HACK: We write a toString property directly because Error is not a real\\n        // class and so inheritance does not work correctly. We could alternatively\\n        // do the same \\\"back-door inheritance\\\" trick that FirebaseError does.\\n        this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class j {\\n    constructor() {\\n        this.promise = new Promise(((t, e) => {\\n            this.resolve = t, this.reject = e;\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class W {\\n    constructor(t, e) {\\n        this.user = e, this.type = \\\"OAuth\\\", this.headers = new Map, this.headers.set(\\\"Authorization\\\", `Bearer ${t}`);\\n    }\\n}\\n\\n/**\\n * A CredentialsProvider that always yields an empty token.\\n * @internal\\n */ class z {\\n    getToken() {\\n        return Promise.resolve(null);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(C.UNAUTHENTICATED)));\\n    }\\n    shutdown() {}\\n}\\n\\n/**\\n * A CredentialsProvider that always returns a constant token. Used for\\n * emulator token mocking.\\n */ class H {\\n    constructor(t) {\\n        this.token = t, \\n        /**\\n         * Stores the listener registered with setChangeListener()\\n         * This isn't actually necessary since the UID never changes, but we use this\\n         * to verify the listen contract is adhered to in tests.\\n         */\\n        this.changeListener = null;\\n    }\\n    getToken() {\\n        return Promise.resolve(this.token);\\n    }\\n    invalidateToken() {}\\n    start(t, e) {\\n        this.changeListener = e, \\n        // Fire with initial user.\\n        t.enqueueRetryable((() => e(this.token.user)));\\n    }\\n    shutdown() {\\n        this.changeListener = null;\\n    }\\n}\\n\\nclass J {\\n    constructor(t) {\\n        this.t = t, \\n        /** Tracks the current User. */\\n        this.currentUser = C.UNAUTHENTICATED, \\n        /**\\n         * Counter used to detect if the token changed while a getToken request was\\n         * outstanding.\\n         */\\n        this.i = 0, this.forceRefresh = !1, this.auth = null;\\n    }\\n    start(t, e) {\\n        let n = this.i;\\n        // A change listener that prevents double-firing for the same token change.\\n                const s = t => this.i !== n ? (n = this.i, e(t)) : Promise.resolve();\\n        // A promise that can be waited on to block on the next token change.\\n        // This promise is re-created after each change.\\n                let i = new j;\\n        this.o = () => {\\n            this.i++, this.currentUser = this.u(), i.resolve(), i = new j, t.enqueueRetryable((() => s(this.currentUser)));\\n        };\\n        const r = () => {\\n            const e = i;\\n            t.enqueueRetryable((async () => {\\n                await e.promise, await s(this.currentUser);\\n            }));\\n        }, o = t => {\\n            O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth detected\\\"), this.auth = t, this.auth.addAuthTokenListener(this.o), \\n            r();\\n        };\\n        this.t.onInit((t => o(t))), \\n        // Our users can initialize Auth right after Firestore, so we give it\\n        // a chance to register itself with the component framework before we\\n        // determine whether to start up in unauthenticated mode.\\n        setTimeout((() => {\\n            if (!this.auth) {\\n                const t = this.t.getImmediate({\\n                    optional: !0\\n                });\\n                t ? o(t) : (\\n                // If auth is still not available, proceed with `null` user\\n                O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"Auth not yet detected\\\"), i.resolve(), i = new j);\\n            }\\n        }), 0), r();\\n    }\\n    getToken() {\\n        // Take note of the current value of the tokenCounter so that this method\\n        // can fail (with an ABORTED error) if there is a token change while the\\n        // request is outstanding.\\n        const t = this.i, e = this.forceRefresh;\\n        return this.forceRefresh = !1, this.auth ? this.auth.getToken(e).then((e => \\n        // Cancel the request since the token changed while the request was\\n        // outstanding so the response is potentially for a previous user (which\\n        // user, we can't be sure).\\n        this.i !== t ? (O(\\\"FirebaseAuthCredentialsProvider\\\", \\\"getToken aborted due to token change.\\\"), \\n        this.getToken()) : e ? (U(\\\"string\\\" == typeof e.accessToken), new W(e.accessToken, this.currentUser)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.auth && this.auth.removeAuthTokenListener(this.o);\\n    }\\n    // Auth.getUid() can return null even with a user logged in. It is because\\n    // getUid() is synchronous, but the auth code populating Uid is asynchronous.\\n    // This method should only be called in the AuthTokenListener callback\\n    // to guarantee to get the actual user.\\n    u() {\\n        const t = this.auth && this.auth.getUid();\\n        return U(null === t || \\\"string\\\" == typeof t), new C(t);\\n    }\\n}\\n\\n/*\\n * FirstPartyToken provides a fresh token each time its value\\n * is requested, because if the token is too old, requests will be rejected.\\n * Technically this may no longer be necessary since the SDK should gracefully\\n * recover from unauthenticated errors (see b/33147818 for context), but it's\\n * safer to keep the implementation as-is.\\n */ class Y {\\n    constructor(t, e, n) {\\n        this.type = \\\"FirstParty\\\", this.user = C.FIRST_PARTY, this.headers = new Map, this.headers.set(\\\"X-Goog-AuthUser\\\", e);\\n        const s = t.auth.getAuthHeaderValueForFirstParty([]);\\n        s && this.headers.set(\\\"Authorization\\\", s), n && this.headers.set(\\\"X-Goog-Iam-Authorization-Token\\\", n);\\n    }\\n}\\n\\n/*\\n * Provides user credentials required for the Firestore JavaScript SDK\\n * to authenticate the user, using technique that is only available\\n * to applications hosted by Google.\\n */ class X {\\n    constructor(t, e, n) {\\n        this.h = t, this.l = e, this.m = n;\\n    }\\n    getToken() {\\n        return Promise.resolve(new Y(this.h, this.l, this.m));\\n    }\\n    start(t, e) {\\n        // Fire with initial uid.\\n        t.enqueueRetryable((() => e(C.FIRST_PARTY)));\\n    }\\n    shutdown() {}\\n    invalidateToken() {}\\n}\\n\\nclass Z {\\n    constructor(t) {\\n        this.value = t, this.type = \\\"AppCheck\\\", this.headers = new Map, t && t.length > 0 && this.headers.set(\\\"x-firebase-appcheck\\\", this.value);\\n    }\\n}\\n\\nclass tt {\\n    constructor(t) {\\n        this.g = t, this.forceRefresh = !1, this.appCheck = null, this.p = null;\\n    }\\n    start(t, e) {\\n        const n = t => {\\n            null != t.error && O(\\\"FirebaseAppCheckTokenProvider\\\", `Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);\\n            const n = t.token !== this.p;\\n            return this.p = t.token, O(\\\"FirebaseAppCheckTokenProvider\\\", `Received ${n ? \\\"new\\\" : \\\"existing\\\"} token.`), \\n            n ? e(t.token) : Promise.resolve();\\n        };\\n        this.o = e => {\\n            t.enqueueRetryable((() => n(e)));\\n        };\\n        const s = t => {\\n            O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck detected\\\"), this.appCheck = t, this.appCheck.addTokenListener(this.o);\\n        };\\n        this.g.onInit((t => s(t))), \\n        // Our users can initialize AppCheck after Firestore, so we give it\\n        // a chance to register itself with the component framework.\\n        setTimeout((() => {\\n            if (!this.appCheck) {\\n                const t = this.g.getImmediate({\\n                    optional: !0\\n                });\\n                t ? s(t) : \\n                // If AppCheck is still not available, proceed without it.\\n                O(\\\"FirebaseAppCheckTokenProvider\\\", \\\"AppCheck not yet detected\\\");\\n            }\\n        }), 0);\\n    }\\n    getToken() {\\n        const t = this.forceRefresh;\\n        return this.forceRefresh = !1, this.appCheck ? this.appCheck.getToken(t).then((t => t ? (U(\\\"string\\\" == typeof t.token), \\n        this.p = t.token, new Z(t.token)) : null)) : Promise.resolve(null);\\n    }\\n    invalidateToken() {\\n        this.forceRefresh = !0;\\n    }\\n    shutdown() {\\n        this.appCheck && this.appCheck.removeTokenListener(this.o);\\n    }\\n}\\n\\n/**\\n * An AppCheck token provider that always yields an empty token.\\n * @internal\\n */ class et {\\n    getToken() {\\n        return Promise.resolve(new Z(\\\"\\\"));\\n    }\\n    invalidateToken() {}\\n    start(t, e) {}\\n    shutdown() {}\\n}\\n\\n/**\\n * Builds a CredentialsProvider depending on the type of\\n * the credentials passed in.\\n */\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\\n * exceed. All subsequent calls to next will return increasing values. If provided with a\\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\\n * well as write out sequence numbers that it produces via `next()`.\\n */\\nclass nt {\\n    constructor(t, e) {\\n        this.previousValue = t, e && (e.sequenceNumberHandler = t => this.I(t), this.T = t => e.writeSequenceNumber(t));\\n    }\\n    I(t) {\\n        return this.previousValue = Math.max(t, this.previousValue), this.previousValue;\\n    }\\n    next() {\\n        const t = ++this.previousValue;\\n        return this.T && this.T(t), t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Generates `nBytes` of random bytes.\\n *\\n * If `nBytes < 0` , an error will be thrown.\\n */\\nfunction st(t) {\\n    // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\\n    const e = \\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    \\\"undefined\\\" != typeof self && (self.crypto || self.msCrypto), n = new Uint8Array(t);\\n    if (e && \\\"function\\\" == typeof e.getRandomValues) e.getRandomValues(n); else \\n    // Falls back to Math.random\\n    for (let e = 0; e < t; e++) n[e] = Math.floor(256 * Math.random());\\n    return n;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ nt.A = -1;\\n\\nclass it {\\n    static R() {\\n        // Alphanumeric characters\\n        const t = \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\\", e = Math.floor(256 / t.length) * t.length;\\n        // The largest byte value that is a multiple of `char.length`.\\n                let n = \\\"\\\";\\n        for (;n.length < 20; ) {\\n            const s = st(40);\\n            for (let i = 0; i < s.length; ++i) \\n            // Only accept values that are [0, maxMultiple), this ensures they can\\n            // be evenly mapped to indices of `chars` via a modulo operation.\\n            n.length < 20 && s[i] < e && (n += t.charAt(s[i] % t.length));\\n        }\\n        return n;\\n    }\\n}\\n\\nfunction rt(t, e) {\\n    return t < e ? -1 : t > e ? 1 : 0;\\n}\\n\\n/** Helper to compare arrays using isEqual(). */ function ot(t, e, n) {\\n    return t.length === e.length && t.every(((t, s) => n(t, e[s])));\\n}\\n\\n/**\\n * Returns the immediate lexicographically-following string. This is useful to\\n * construct an inclusive range for indexeddb iterators.\\n */ function ut(t) {\\n    // Return the input string, with an additional NUL byte appended.\\n    return t + \\\"\\\\0\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\\n/**\\n * A `Timestamp` represents a point in time independent of any time zone or\\n * calendar, represented as seconds and fractions of seconds at nanosecond\\n * resolution in UTC Epoch time.\\n *\\n * It is encoded using the Proleptic Gregorian Calendar which extends the\\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\\n * are 60 seconds long, i.e. leap seconds are \\\"smeared\\\" so that no leap second\\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\\n * 9999-12-31T23:59:59.999999999Z.\\n *\\n * For examples and further specifications, refer to the\\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\\n */\\nclass at {\\n    /**\\n     * Creates a new timestamp.\\n     *\\n     * @param seconds - The number of seconds of UTC time since Unix epoch\\n     *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\\n     *     9999-12-31T23:59:59Z inclusive.\\n     * @param nanoseconds - The non-negative fractions of a second at nanosecond\\n     *     resolution. Negative second values with fractions must still have\\n     *     non-negative nanoseconds values that count forward in time. Must be\\n     *     from 0 to 999,999,999 inclusive.\\n     */\\n    constructor(\\n    /**\\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\\n     */\\n    t, \\n    /**\\n     * The fractions of a second at nanosecond resolution.*\\n     */\\n    e) {\\n        if (this.seconds = t, this.nanoseconds = e, e < 0) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (e >= 1e9) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp nanoseconds out of range: \\\" + e);\\n        if (t < -62135596800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n        // This will break in the year 10,000.\\n                if (t >= 253402300800) throw new Q(G.INVALID_ARGUMENT, \\\"Timestamp seconds out of range: \\\" + t);\\n    }\\n    /**\\n     * Creates a new timestamp with the current date, with millisecond precision.\\n     *\\n     * @returns a new timestamp representing the current date.\\n     */    static now() {\\n        return at.fromMillis(Date.now());\\n    }\\n    /**\\n     * Creates a new timestamp from the given date.\\n     *\\n     * @param date - The date to initialize the `Timestamp` from.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     date.\\n     */    static fromDate(t) {\\n        return at.fromMillis(t.getTime());\\n    }\\n    /**\\n     * Creates a new timestamp from the given number of milliseconds.\\n     *\\n     * @param milliseconds - Number of milliseconds since Unix epoch\\n     *     1970-01-01T00:00:00Z.\\n     * @returns A new `Timestamp` representing the same point in time as the given\\n     *     number of milliseconds.\\n     */    static fromMillis(t) {\\n        const e = Math.floor(t / 1e3), n = Math.floor(1e6 * (t - 1e3 * e));\\n        return new at(e, n);\\n    }\\n    /**\\n     * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\\n     * causes a loss of precision since `Date` objects only support millisecond\\n     * precision.\\n     *\\n     * @returns JavaScript `Date` object representing the same point in time as\\n     *     this `Timestamp`, with millisecond precision.\\n     */    toDate() {\\n        return new Date(this.toMillis());\\n    }\\n    /**\\n     * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\\n     * epoch). This operation causes a loss of precision.\\n     *\\n     * @returns The point in time corresponding to this timestamp, represented as\\n     *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\\n     */    toMillis() {\\n        return 1e3 * this.seconds + this.nanoseconds / 1e6;\\n    }\\n    _compareTo(t) {\\n        return this.seconds === t.seconds ? rt(this.nanoseconds, t.nanoseconds) : rt(this.seconds, t.seconds);\\n    }\\n    /**\\n     * Returns true if this `Timestamp` is equal to the provided one.\\n     *\\n     * @param other - The `Timestamp` to compare against.\\n     * @returns true if this `Timestamp` is equal to the provided one.\\n     */    isEqual(t) {\\n        return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;\\n    }\\n    /** Returns a textual representation of this `Timestamp`. */    toString() {\\n        return \\\"Timestamp(seconds=\\\" + this.seconds + \\\", nanoseconds=\\\" + this.nanoseconds + \\\")\\\";\\n    }\\n    /** Returns a JSON-serializable representation of this `Timestamp`. */    toJSON() {\\n        return {\\n            seconds: this.seconds,\\n            nanoseconds: this.nanoseconds\\n        };\\n    }\\n    /**\\n     * Converts this object to a primitive string, which allows `Timestamp` objects\\n     * to be compared using the `>`, `<=`, `>=` and `>` operators.\\n     */    valueOf() {\\n        // This method returns a string of the form <seconds>.<nanoseconds> where\\n        // <seconds> is translated to have a non-negative value and both <seconds>\\n        // and <nanoseconds> are left-padded with zeroes to be a consistent length.\\n        // Strings with this format then have a lexiographical ordering that matches\\n        // the expected ordering. The <seconds> translation is done to avoid having\\n        // a leading negative sign (i.e. a leading '-' character) in its string\\n        // representation, which would affect its lexiographical ordering.\\n        const t = this.seconds - -62135596800;\\n        // Note: Up to 12 decimal digits are required to represent all valid\\n        // 'seconds' values.\\n                return String(t).padStart(12, \\\"0\\\") + \\\".\\\" + String(this.nanoseconds).padStart(9, \\\"0\\\");\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A version of a document in Firestore. This corresponds to the version\\n * timestamp, such as update_time or read_time.\\n */ class ct {\\n    constructor(t) {\\n        this.timestamp = t;\\n    }\\n    static fromTimestamp(t) {\\n        return new ct(t);\\n    }\\n    static min() {\\n        return new ct(new at(0, 0));\\n    }\\n    static max() {\\n        return new ct(new at(253402300799, 999999999));\\n    }\\n    compareTo(t) {\\n        return this.timestamp._compareTo(t.timestamp);\\n    }\\n    isEqual(t) {\\n        return this.timestamp.isEqual(t.timestamp);\\n    }\\n    /** Returns a number representation of the version for use in spec tests. */    toMicroseconds() {\\n        // Convert to microseconds.\\n        return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3;\\n    }\\n    toString() {\\n        return \\\"SnapshotVersion(\\\" + this.timestamp.toString() + \\\")\\\";\\n    }\\n    toTimestamp() {\\n        return this.timestamp;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function ht(t) {\\n    let e = 0;\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;\\n    return e;\\n}\\n\\nfunction lt(t, e) {\\n    for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);\\n}\\n\\nfunction ft(t) {\\n    for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Path represents an ordered sequence of string segments.\\n */\\nclass dt {\\n    constructor(t, e, n) {\\n        void 0 === e ? e = 0 : e > t.length && L(), void 0 === n ? n = t.length - e : n > t.length - e && L(), \\n        this.segments = t, this.offset = e, this.len = n;\\n    }\\n    get length() {\\n        return this.len;\\n    }\\n    isEqual(t) {\\n        return 0 === dt.comparator(this, t);\\n    }\\n    child(t) {\\n        const e = this.segments.slice(this.offset, this.limit());\\n        return t instanceof dt ? t.forEach((t => {\\n            e.push(t);\\n        })) : e.push(t), this.construct(e);\\n    }\\n    /** The index of one past the last segment of the path. */    limit() {\\n        return this.offset + this.length;\\n    }\\n    popFirst(t) {\\n        return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t);\\n    }\\n    popLast() {\\n        return this.construct(this.segments, this.offset, this.length - 1);\\n    }\\n    firstSegment() {\\n        return this.segments[this.offset];\\n    }\\n    lastSegment() {\\n        return this.get(this.length - 1);\\n    }\\n    get(t) {\\n        return this.segments[this.offset + t];\\n    }\\n    isEmpty() {\\n        return 0 === this.length;\\n    }\\n    isPrefixOf(t) {\\n        if (t.length < this.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    isImmediateParentOf(t) {\\n        if (this.length + 1 !== t.length) return !1;\\n        for (let e = 0; e < this.length; e++) if (this.get(e) !== t.get(e)) return !1;\\n        return !0;\\n    }\\n    forEach(t) {\\n        for (let e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]);\\n    }\\n    toArray() {\\n        return this.segments.slice(this.offset, this.limit());\\n    }\\n    static comparator(t, e) {\\n        const n = Math.min(t.length, e.length);\\n        for (let s = 0; s < n; s++) {\\n            const n = t.get(s), i = e.get(s);\\n            if (n < i) return -1;\\n            if (n > i) return 1;\\n        }\\n        return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;\\n    }\\n}\\n\\n/**\\n * A slash-separated path for navigating resources (documents and collections)\\n * within Firestore.\\n *\\n * @internal\\n */ class _t extends dt {\\n    construct(t, e, n) {\\n        return new _t(t, e, n);\\n    }\\n    canonicalString() {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        return this.toArray().join(\\\"/\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Creates a resource path from the given slash-delimited string. If multiple\\n     * arguments are provided, all components are combined. Leading and trailing\\n     * slashes from all components are ignored.\\n     */    static fromString(...t) {\\n        // NOTE: The client is ignorant of any path segments containing escape\\n        // sequences (e.g. __id123__) and just passes them through raw (they exist\\n        // for legacy reasons and should not be used frequently).\\n        const e = [];\\n        for (const n of t) {\\n            if (n.indexOf(\\\"//\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid segment (${n}). Paths must not contain // in them.`);\\n            // Strip leading and traling slashed.\\n                        e.push(...n.split(\\\"/\\\").filter((t => t.length > 0)));\\n        }\\n        return new _t(e);\\n    }\\n    static emptyPath() {\\n        return new _t([]);\\n    }\\n}\\n\\nconst wt = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\\n\\n/**\\n * A dot-separated path for navigating sub-objects within a document.\\n * @internal\\n */ class mt extends dt {\\n    construct(t, e, n) {\\n        return new mt(t, e, n);\\n    }\\n    /**\\n     * Returns true if the string could be used as a segment in a field path\\n     * without escaping.\\n     */    static isValidIdentifier(t) {\\n        return wt.test(t);\\n    }\\n    canonicalString() {\\n        return this.toArray().map((t => (t = t.replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\").replace(/`/g, \\\"\\\\\\\\`\\\"), \\n        mt.isValidIdentifier(t) || (t = \\\"`\\\" + t + \\\"`\\\"), t))).join(\\\".\\\");\\n    }\\n    toString() {\\n        return this.canonicalString();\\n    }\\n    /**\\n     * Returns true if this field references the key of a document.\\n     */    isKeyField() {\\n        return 1 === this.length && \\\"__name__\\\" === this.get(0);\\n    }\\n    /**\\n     * The field designating the key of a document.\\n     */    static keyField() {\\n        return new mt([ \\\"__name__\\\" ]);\\n    }\\n    /**\\n     * Parses a field string from the given server-formatted string.\\n     *\\n     * - Splitting the empty string is not allowed (for now at least).\\n     * - Empty segments within the string (e.g. if there are two consecutive\\n     *   separators) are not allowed.\\n     *\\n     * TODO(b/37244157): we should make this more strict. Right now, it allows\\n     * non-identifier path components, even if they aren't escaped.\\n     */    static fromServerFormat(t) {\\n        const e = [];\\n        let n = \\\"\\\", s = 0;\\n        const i = () => {\\n            if (0 === n.length) throw new Q(G.INVALID_ARGUMENT, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);\\n            e.push(n), n = \\\"\\\";\\n        };\\n        let r = !1;\\n        for (;s < t.length; ) {\\n            const e = t[s];\\n            if (\\\"\\\\\\\\\\\" === e) {\\n                if (s + 1 === t.length) throw new Q(G.INVALID_ARGUMENT, \\\"Path has trailing escape character: \\\" + t);\\n                const e = t[s + 1];\\n                if (\\\"\\\\\\\\\\\" !== e && \\\".\\\" !== e && \\\"`\\\" !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Path has invalid escape sequence: \\\" + t);\\n                n += e, s += 2;\\n            } else \\\"`\\\" === e ? (r = !r, s++) : \\\".\\\" !== e || r ? (n += e, s++) : (i(), s++);\\n        }\\n        if (i(), r) throw new Q(G.INVALID_ARGUMENT, \\\"Unterminated ` in path: \\\" + t);\\n        return new mt(e);\\n    }\\n    static emptyPath() {\\n        return new mt([]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a set of fields that can be used to partially patch a document.\\n * FieldMask is used in conjunction with ObjectValue.\\n * Examples:\\n *   foo - Overwrites foo entirely with the provided value. If foo is not\\n *         present in the companion ObjectValue, the field is deleted.\\n *   foo.bar - Overwrites only the field bar of the object foo.\\n *             If foo is not an object, foo is replaced with an object\\n *             containing foo\\n */ class gt {\\n    constructor(t) {\\n        this.fields = t, \\n        // TODO(dimond): validation of FieldMask\\n        // Sort the field mask to support `FieldMask.isEqual()` and assert below.\\n        t.sort(mt.comparator);\\n    }\\n    /**\\n     * Verifies that `fieldPath` is included by at least one field in this field\\n     * mask.\\n     *\\n     * This is an O(n) operation, where `n` is the size of the field mask.\\n     */    covers(t) {\\n        for (const e of this.fields) if (e.isPrefixOf(t)) return !0;\\n        return !1;\\n    }\\n    isEqual(t) {\\n        return ot(this.fields, t.fields, ((t, e) => t.isEqual(e)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Converts a Base64 encoded string to a binary string. */\\n/** True if and only if the Base64 conversion functions are available. */\\nfunction yt() {\\n    return \\\"undefined\\\" != typeof atob;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Immutable class that represents a \\\"proto\\\" byte string.\\n *\\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\\n * sent on the wire. This class abstracts away this differentiation by holding\\n * the proto byte string in a common class that must be converted into a string\\n * before being sent as a proto.\\n * @internal\\n */ class pt {\\n    constructor(t) {\\n        this.binaryString = t;\\n    }\\n    static fromBase64String(t) {\\n        const e = atob(t);\\n        return new pt(e);\\n    }\\n    static fromUint8Array(t) {\\n        // TODO(indexing); Remove the copy of the byte string here as this method\\n        // is frequently called during indexing.\\n        const e = \\n        /**\\n * Helper function to convert an Uint8array to a binary string.\\n */\\n        function(t) {\\n            let e = \\\"\\\";\\n            for (let n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]);\\n            return e;\\n        }\\n        /**\\n * Helper function to convert a binary string to an Uint8Array.\\n */ (t);\\n        return new pt(e);\\n    }\\n    [Symbol.iterator]() {\\n        let t = 0;\\n        return {\\n            next: () => t < this.binaryString.length ? {\\n                value: this.binaryString.charCodeAt(t++),\\n                done: !1\\n            } : {\\n                value: void 0,\\n                done: !0\\n            }\\n        };\\n    }\\n    toBase64() {\\n        return t = this.binaryString, btoa(t);\\n        /** Converts a binary string to a Base64 encoded string. */\\n        var t;\\n    }\\n    toUint8Array() {\\n        return function(t) {\\n            const e = new Uint8Array(t.length);\\n            for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);\\n            return e;\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n        // A RegExp matching ISO 8601 UTC timestamps with optional fraction.\\n        (this.binaryString);\\n    }\\n    approximateByteSize() {\\n        return 2 * this.binaryString.length;\\n    }\\n    compareTo(t) {\\n        return rt(this.binaryString, t.binaryString);\\n    }\\n    isEqual(t) {\\n        return this.binaryString === t.binaryString;\\n    }\\n}\\n\\npt.EMPTY_BYTE_STRING = new pt(\\\"\\\");\\n\\nconst It = new RegExp(/^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\d\\\\d:\\\\d\\\\d:\\\\d\\\\d(?:\\\\.(\\\\d+))?Z$/);\\n\\n/**\\n * Converts the possible Proto values for a timestamp value into a \\\"seconds and\\n * nanos\\\" representation.\\n */ function Tt(t) {\\n    // The json interface (for the browser) will return an iso timestamp string,\\n    // while the proto js library (for node) will return a\\n    // google.protobuf.Timestamp instance.\\n    if (U(!!t), \\\"string\\\" == typeof t) {\\n        // The date string can have higher precision (nanos) than the Date class\\n        // (millis), so we do some custom parsing here.\\n        // Parse the nanos right out of the string.\\n        let e = 0;\\n        const n = It.exec(t);\\n        if (U(!!n), n[1]) {\\n            // Pad the fraction out to 9 digits (nanos).\\n            let t = n[1];\\n            t = (t + \\\"000000000\\\").substr(0, 9), e = Number(t);\\n        }\\n        // Parse the date to get the seconds.\\n                const s = new Date(t);\\n        return {\\n            seconds: Math.floor(s.getTime() / 1e3),\\n            nanos: e\\n        };\\n    }\\n    return {\\n        seconds: Et(t.seconds),\\n        nanos: Et(t.nanos)\\n    };\\n}\\n\\n/**\\n * Converts the possible Proto types for numbers into a JavaScript number.\\n * Returns 0 if the value is not numeric.\\n */ function Et(t) {\\n    // TODO(bjornick): Handle int64 greater than 53 bits.\\n    return \\\"number\\\" == typeof t ? t : \\\"string\\\" == typeof t ? Number(t) : 0;\\n}\\n\\n/** Converts the possible Proto types for Blobs into a ByteString. */ function At(t) {\\n    return \\\"string\\\" == typeof t ? pt.fromBase64String(t) : pt.fromUint8Array(t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a locally-applied ServerTimestamp.\\n *\\n * Server Timestamps are backed by MapValues that contain an internal field\\n * `__type__` with a value of `server_timestamp`. The previous value and local\\n * write time are stored in its `__previous_value__` and `__local_write_time__`\\n * fields respectively.\\n *\\n * Notes:\\n * - ServerTimestampValue instances are created as the result of applying a\\n *   transform. They can only exist in the local view of a document. Therefore\\n *   they do not need to be parsed or serialized.\\n * - When evaluated locally (e.g. for snapshot.data()), they by default\\n *   evaluate to `null`. This behavior can be configured by passing custom\\n *   FieldValueOptions to value().\\n * - With respect to other ServerTimestampValues, they sort by their\\n *   localWriteTime.\\n */ function Rt(t) {\\n    var e, n;\\n    return \\\"server_timestamp\\\" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);\\n}\\n\\n/**\\n * Creates a new ServerTimestamp proto value (using the internal format).\\n */\\n/**\\n * Returns the value of the field before this ServerTimestamp was set.\\n *\\n * Preserving the previous values allows the user to display the last resoled\\n * value until the backend responds with the timestamp.\\n */\\nfunction bt(t) {\\n    const e = t.mapValue.fields.__previous_value__;\\n    return Rt(e) ? bt(e) : e;\\n}\\n\\n/**\\n * Returns the local time at which this timestamp was first set.\\n */ function Pt(t) {\\n    const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);\\n    return new at(e.seconds, e.nanos);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Vt {\\n    /**\\n     * Constructs a DatabaseInfo using the provided host, databaseId and\\n     * persistenceKey.\\n     *\\n     * @param databaseId - The database to use.\\n     * @param appId - The Firebase App Id.\\n     * @param persistenceKey - A unique identifier for this Firestore's local\\n     * storage (used in conjunction with the databaseId).\\n     * @param host - The Firestore backend host to connect to.\\n     * @param ssl - Whether to use SSL when connecting.\\n     * @param forceLongPolling - Whether to use the forceLongPolling option\\n     * when using WebChannel as the network transport.\\n     * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\\n     * option when using WebChannel as the network transport.\\n     * @param useFetchStreams Whether to use the Fetch API instead of\\n     * XMLHTTPRequest\\n     */\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i, \\n        this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = u;\\n    }\\n}\\n\\n/** The default database name for a project. */\\n/**\\n * Represents the database ID a Firestore client is associated with.\\n * @internal\\n */\\nclass vt {\\n    constructor(t, e) {\\n        this.projectId = t, this.database = e || \\\"(default)\\\";\\n    }\\n    static empty() {\\n        return new vt(\\\"\\\", \\\"\\\");\\n    }\\n    get isDefaultDatabase() {\\n        return \\\"(default)\\\" === this.database;\\n    }\\n    isEqual(t) {\\n        return t instanceof vt && t.projectId === this.projectId && t.database === this.database;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Sentinel value that sorts before any Mutation Batch ID. */\\n/**\\n * Returns whether a variable is either undefined or null.\\n */\\nfunction St(t) {\\n    return null == t;\\n}\\n\\n/** Returns whether the value represents -0. */ function Dt(t) {\\n    // Detect if the value is -0.0. Based on polyfill from\\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\\n    return 0 === t && 1 / t == -1 / 0;\\n}\\n\\n/**\\n * Returns whether a value is an integer and in the safe integer range\\n * @param value - The value to test for being an integer and in the safe range\\n */ function Ct(t) {\\n    return \\\"number\\\" == typeof t && Number.isInteger(t) && !Dt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @internal\\n */ class xt {\\n    constructor(t) {\\n        this.path = t;\\n    }\\n    static fromPath(t) {\\n        return new xt(_t.fromString(t));\\n    }\\n    static fromName(t) {\\n        return new xt(_t.fromString(t).popFirst(5));\\n    }\\n    static empty() {\\n        return new xt(_t.emptyPath());\\n    }\\n    get collectionGroup() {\\n        return this.path.popLast().lastSegment();\\n    }\\n    /** Returns true if the document is in the specified collectionId. */    hasCollectionId(t) {\\n        return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;\\n    }\\n    /** Returns the collection group (i.e. the name of the parent collection) for this key. */    getCollectionGroup() {\\n        return this.path.get(this.path.length - 2);\\n    }\\n    /** Returns the fully qualified path to the parent collection. */    getCollectionPath() {\\n        return this.path.popLast();\\n    }\\n    isEqual(t) {\\n        return null !== t && 0 === _t.comparator(this.path, t.path);\\n    }\\n    toString() {\\n        return this.path.toString();\\n    }\\n    static comparator(t, e) {\\n        return _t.comparator(t.path, e.path);\\n    }\\n    static isDocumentKey(t) {\\n        return t.length % 2 == 0;\\n    }\\n    /**\\n     * Creates and returns a new document key with the given segments.\\n     *\\n     * @param segments - The segments of the path to the document\\n     * @returns A new instance of DocumentKey\\n     */    static fromSegments(t) {\\n        return new xt(new _t(t.slice()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Nt = {\\n    mapValue: {\\n        fields: {\\n            __type__: {\\n                stringValue: \\\"__max__\\\"\\n            }\\n        }\\n    }\\n}, kt = {\\n    nullValue: \\\"NULL_VALUE\\\"\\n};\\n\\n/** Extracts the backend's type order for the provided value. */\\nfunction Mt(t) {\\n    return \\\"nullValue\\\" in t ? 0 /* NullValue */ : \\\"booleanValue\\\" in t ? 1 /* BooleanValue */ : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? 2 /* NumberValue */ : \\\"timestampValue\\\" in t ? 3 /* TimestampValue */ : \\\"stringValue\\\" in t ? 5 /* StringValue */ : \\\"bytesValue\\\" in t ? 6 /* BlobValue */ : \\\"referenceValue\\\" in t ? 7 /* RefValue */ : \\\"geoPointValue\\\" in t ? 8 /* GeoPointValue */ : \\\"arrayValue\\\" in t ? 9 /* ArrayValue */ : \\\"mapValue\\\" in t ? Rt(t) ? 4 /* ServerTimestampValue */ : Ht(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : L();\\n}\\n\\n/** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {\\n    if (t === e) return !0;\\n    const n = Mt(t);\\n    if (n !== Mt(e)) return !1;\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return !0;\\n\\n      case 1 /* BooleanValue */ :\\n        return t.booleanValue === e.booleanValue;\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Pt(t).isEqual(Pt(e));\\n\\n      case 3 /* TimestampValue */ :\\n        return function(t, e) {\\n            if (\\\"string\\\" == typeof t.timestampValue && \\\"string\\\" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length) \\n            // Use string equality for ISO 8601 timestamps\\n            return t.timestampValue === e.timestampValue;\\n            const n = Tt(t.timestampValue), s = Tt(e.timestampValue);\\n            return n.seconds === s.seconds && n.nanos === s.nanos;\\n        }(t, e);\\n\\n      case 5 /* StringValue */ :\\n        return t.stringValue === e.stringValue;\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            return At(t.bytesValue).isEqual(At(e.bytesValue));\\n        }(t, e);\\n\\n      case 7 /* RefValue */ :\\n        return t.referenceValue === e.referenceValue;\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            return Et(t.geoPointValue.latitude) === Et(e.geoPointValue.latitude) && Et(t.geoPointValue.longitude) === Et(e.geoPointValue.longitude);\\n        }(t, e);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            if (\\\"integerValue\\\" in t && \\\"integerValue\\\" in e) return Et(t.integerValue) === Et(e.integerValue);\\n            if (\\\"doubleValue\\\" in t && \\\"doubleValue\\\" in e) {\\n                const n = Et(t.doubleValue), s = Et(e.doubleValue);\\n                return n === s ? Dt(n) === Dt(s) : isNaN(n) && isNaN(s);\\n            }\\n            return !1;\\n        }(t, e);\\n\\n      case 9 /* ArrayValue */ :\\n        return ot(t.arrayValue.values || [], e.arrayValue.values || [], Ot);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            const n = t.mapValue.fields || {}, s = e.mapValue.fields || {};\\n            if (ht(n) !== ht(s)) return !1;\\n            for (const t in n) if (n.hasOwnProperty(t) && (void 0 === s[t] || !Ot(n[t], s[t]))) return !1;\\n            return !0;\\n        }\\n        /** Returns true if the ArrayValue contains the specified element. */ (t, e);\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction Ft(t, e) {\\n    return void 0 !== (t.values || []).find((t => Ot(t, e)));\\n}\\n\\nfunction $t(t, e) {\\n    if (t === e) return 0;\\n    const n = Mt(t), s = Mt(e);\\n    if (n !== s) return rt(n, s);\\n    switch (n) {\\n      case 0 /* NullValue */ :\\n      case 9007199254740991 /* MaxValue */ :\\n        return 0;\\n\\n      case 1 /* BooleanValue */ :\\n        return rt(t.booleanValue, e.booleanValue);\\n\\n      case 2 /* NumberValue */ :\\n        return function(t, e) {\\n            const n = Et(t.integerValue || t.doubleValue), s = Et(e.integerValue || e.doubleValue);\\n            return n < s ? -1 : n > s ? 1 : n === s ? 0 : \\n            // one or both are NaN.\\n            isNaN(n) ? isNaN(s) ? 0 : -1 : 1;\\n        }(t, e);\\n\\n      case 3 /* TimestampValue */ :\\n        return Bt(t.timestampValue, e.timestampValue);\\n\\n      case 4 /* ServerTimestampValue */ :\\n        return Bt(Pt(t), Pt(e));\\n\\n      case 5 /* StringValue */ :\\n        return rt(t.stringValue, e.stringValue);\\n\\n      case 6 /* BlobValue */ :\\n        return function(t, e) {\\n            const n = At(t), s = At(e);\\n            return n.compareTo(s);\\n        }(t.bytesValue, e.bytesValue);\\n\\n      case 7 /* RefValue */ :\\n        return function(t, e) {\\n            const n = t.split(\\\"/\\\"), s = e.split(\\\"/\\\");\\n            for (let t = 0; t < n.length && t < s.length; t++) {\\n                const e = rt(n[t], s[t]);\\n                if (0 !== e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.referenceValue, e.referenceValue);\\n\\n      case 8 /* GeoPointValue */ :\\n        return function(t, e) {\\n            const n = rt(Et(t.latitude), Et(e.latitude));\\n            if (0 !== n) return n;\\n            return rt(Et(t.longitude), Et(e.longitude));\\n        }(t.geoPointValue, e.geoPointValue);\\n\\n      case 9 /* ArrayValue */ :\\n        return function(t, e) {\\n            const n = t.values || [], s = e.values || [];\\n            for (let t = 0; t < n.length && t < s.length; ++t) {\\n                const e = $t(n[t], s[t]);\\n                if (e) return e;\\n            }\\n            return rt(n.length, s.length);\\n        }(t.arrayValue, e.arrayValue);\\n\\n      case 10 /* ObjectValue */ :\\n        return function(t, e) {\\n            if (t === Nt.mapValue && e === Nt.mapValue) return 0;\\n            if (t === Nt.mapValue) return 1;\\n            if (e === Nt.mapValue) return -1;\\n            const n = t.fields || {}, s = Object.keys(n), i = e.fields || {}, r = Object.keys(i);\\n            // Even though MapValues are likely sorted correctly based on their insertion\\n            // order (e.g. when received from the backend), local modifications can bring\\n            // elements out of order. We need to re-sort the elements to ensure that\\n            // canonical IDs are independent of insertion order.\\n            s.sort(), r.sort();\\n            for (let t = 0; t < s.length && t < r.length; ++t) {\\n                const e = rt(s[t], r[t]);\\n                if (0 !== e) return e;\\n                const o = $t(n[s[t]], i[r[t]]);\\n                if (0 !== o) return o;\\n            }\\n            return rt(s.length, r.length);\\n        }\\n        /**\\n * Generates the canonical ID for the provided field value (as used in Target\\n * serialization).\\n */ (t.mapValue, e.mapValue);\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\nfunction Bt(t, e) {\\n    if (\\\"string\\\" == typeof t && \\\"string\\\" == typeof e && t.length === e.length) return rt(t, e);\\n    const n = Tt(t), s = Tt(e), i = rt(n.seconds, s.seconds);\\n    return 0 !== i ? i : rt(n.nanos, s.nanos);\\n}\\n\\nfunction Lt(t) {\\n    return Ut(t);\\n}\\n\\nfunction Ut(t) {\\n    return \\\"nullValue\\\" in t ? \\\"null\\\" : \\\"booleanValue\\\" in t ? \\\"\\\" + t.booleanValue : \\\"integerValue\\\" in t ? \\\"\\\" + t.integerValue : \\\"doubleValue\\\" in t ? \\\"\\\" + t.doubleValue : \\\"timestampValue\\\" in t ? function(t) {\\n        const e = Tt(t);\\n        return `time(${e.seconds},${e.nanos})`;\\n    }(t.timestampValue) : \\\"stringValue\\\" in t ? t.stringValue : \\\"bytesValue\\\" in t ? At(t.bytesValue).toBase64() : \\\"referenceValue\\\" in t ? (n = t.referenceValue, \\n    xt.fromName(n).toString()) : \\\"geoPointValue\\\" in t ? `geo(${(e = t.geoPointValue).latitude},${e.longitude})` : \\\"arrayValue\\\" in t ? function(t) {\\n        let e = \\\"[\\\", n = !0;\\n        for (const s of t.values || []) n ? n = !1 : e += \\\",\\\", e += Ut(s);\\n        return e + \\\"]\\\";\\n    }\\n    /** Returns a reference value for the provided database and key. */ (t.arrayValue) : \\\"mapValue\\\" in t ? function(t) {\\n        // Iteration order in JavaScript is not guaranteed. To ensure that we generate\\n        // matching canonical IDs for identical maps, we need to sort the keys.\\n        const e = Object.keys(t.fields || {}).sort();\\n        let n = \\\"{\\\", s = !0;\\n        for (const i of e) s ? s = !1 : n += \\\",\\\", n += `${i}:${Ut(t.fields[i])}`;\\n        return n + \\\"}\\\";\\n    }(t.mapValue) : L();\\n    var e, n;\\n}\\n\\nfunction qt(t, e) {\\n    return {\\n        referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`\\n    };\\n}\\n\\n/** Returns true if `value` is an IntegerValue . */ function Kt(t) {\\n    return !!t && \\\"integerValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a DoubleValue. */\\n/** Returns true if `value` is an ArrayValue. */\\nfunction Gt(t) {\\n    return !!t && \\\"arrayValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is a NullValue. */ function Qt(t) {\\n    return !!t && \\\"nullValue\\\" in t;\\n}\\n\\n/** Returns true if `value` is NaN. */ function jt(t) {\\n    return !!t && \\\"doubleValue\\\" in t && isNaN(Number(t.doubleValue));\\n}\\n\\n/** Returns true if `value` is a MapValue. */ function Wt(t) {\\n    return !!t && \\\"mapValue\\\" in t;\\n}\\n\\n/** Creates a deep copy of `source`. */ function zt(t) {\\n    if (t.geoPointValue) return {\\n        geoPointValue: Object.assign({}, t.geoPointValue)\\n    };\\n    if (t.timestampValue && \\\"object\\\" == typeof t.timestampValue) return {\\n        timestampValue: Object.assign({}, t.timestampValue)\\n    };\\n    if (t.mapValue) {\\n        const e = {\\n            mapValue: {\\n                fields: {}\\n            }\\n        };\\n        return lt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = zt(n))), e;\\n    }\\n    if (t.arrayValue) {\\n        const e = {\\n            arrayValue: {\\n                values: []\\n            }\\n        };\\n        for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = zt(t.arrayValue.values[n]);\\n        return e;\\n    }\\n    return Object.assign({}, t);\\n}\\n\\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */ function Ht(t) {\\n    return \\\"__max__\\\" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;\\n}\\n\\n/** Returns the lowest value for the given value type (inclusive). */ function Jt(t) {\\n    return \\\"nullValue\\\" in t ? kt : \\\"booleanValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"timestampValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"stringValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"referenceValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"geoPointValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"arrayValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"mapValue\\\" in t ? {\\n        mapValue: {}\\n    } : L();\\n}\\n\\n/** Returns the largest value for the given value type (exclusive). */ function Yt(t) {\\n    return \\\"nullValue\\\" in t ? {\\n        booleanValue: !1\\n    } : \\\"booleanValue\\\" in t ? {\\n        doubleValue: NaN\\n    } : \\\"integerValue\\\" in t || \\\"doubleValue\\\" in t ? {\\n        timestampValue: {\\n            seconds: Number.MIN_SAFE_INTEGER\\n        }\\n    } : \\\"timestampValue\\\" in t ? {\\n        stringValue: \\\"\\\"\\n    } : \\\"stringValue\\\" in t ? {\\n        bytesValue: \\\"\\\"\\n    } : \\\"bytesValue\\\" in t ? qt(vt.empty(), xt.empty()) : \\\"referenceValue\\\" in t ? {\\n        geoPointValue: {\\n            latitude: -90,\\n            longitude: -180\\n        }\\n    } : \\\"geoPointValue\\\" in t ? {\\n        arrayValue: {}\\n    } : \\\"arrayValue\\\" in t ? {\\n        mapValue: {}\\n    } : \\\"mapValue\\\" in t ? Nt : L();\\n}\\n\\nfunction Xt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? -1 : !t.inclusive && e.inclusive ? 1 : 0;\\n}\\n\\nfunction Zt(t, e) {\\n    const n = $t(t.value, e.value);\\n    return 0 !== n ? n : t.inclusive && !e.inclusive ? 1 : !t.inclusive && e.inclusive ? -1 : 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\\n * ability to add and remove fields (via the ObjectValueBuilder).\\n */ class te {\\n    constructor(t) {\\n        this.value = t;\\n    }\\n    static empty() {\\n        return new te({\\n            mapValue: {}\\n        });\\n    }\\n    /**\\n     * Returns the value at the given path or null.\\n     *\\n     * @param path - the path to search\\n     * @returns The value at the path or null if the path is not set.\\n     */    field(t) {\\n        if (t.isEmpty()) return this.value;\\n        {\\n            let e = this.value;\\n            for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)], \\n            !Wt(e)) return null;\\n            return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;\\n        }\\n    }\\n    /**\\n     * Sets the field to the provided value.\\n     *\\n     * @param path - The field path to set.\\n     * @param value - The value to set.\\n     */    set(t, e) {\\n        this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);\\n    }\\n    /**\\n     * Sets the provided fields to the provided values.\\n     *\\n     * @param data - A map of fields to values (or null for deletes).\\n     */    setAll(t) {\\n        let e = mt.emptyPath(), n = {}, s = [];\\n        t.forEach(((t, i) => {\\n            if (!e.isImmediateParentOf(i)) {\\n                // Insert the accumulated changes at this parent location\\n                const t = this.getFieldsMap(e);\\n                this.applyChanges(t, n, s), n = {}, s = [], e = i.popLast();\\n            }\\n            t ? n[i.lastSegment()] = zt(t) : s.push(i.lastSegment());\\n        }));\\n        const i = this.getFieldsMap(e);\\n        this.applyChanges(i, n, s);\\n    }\\n    /**\\n     * Removes the field at the specified path. If there is no field at the\\n     * specified path, nothing is changed.\\n     *\\n     * @param path - The field path to remove.\\n     */    delete(t) {\\n        const e = this.field(t.popLast());\\n        Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\\n    }\\n    isEqual(t) {\\n        return Ot(this.value, t.value);\\n    }\\n    /**\\n     * Returns the map that contains the leaf element of `path`. If the parent\\n     * entry does not yet exist, or if it is not a map, a new map will be created.\\n     */    getFieldsMap(t) {\\n        let e = this.value;\\n        e.mapValue.fields || (e.mapValue = {\\n            fields: {}\\n        });\\n        for (let n = 0; n < t.length; ++n) {\\n            let s = e.mapValue.fields[t.get(n)];\\n            Wt(s) && s.mapValue.fields || (s = {\\n                mapValue: {\\n                    fields: {}\\n                }\\n            }, e.mapValue.fields[t.get(n)] = s), e = s;\\n        }\\n        return e.mapValue.fields;\\n    }\\n    /**\\n     * Modifies `fieldsMap` by adding, replacing or deleting the specified\\n     * entries.\\n     */    applyChanges(t, e, n) {\\n        lt(e, ((e, n) => t[e] = n));\\n        for (const e of n) delete t[e];\\n    }\\n    clone() {\\n        return new te(zt(this.value));\\n    }\\n}\\n\\n/**\\n * Returns a FieldMask built from all fields in a MapValue.\\n */ function ee(t) {\\n    const e = [];\\n    return lt(t.fields, ((t, n) => {\\n        const s = new mt([ t ]);\\n        if (Wt(n)) {\\n            const t = ee(n.mapValue).fields;\\n            if (0 === t.length) \\n            // Preserve the empty map by adding it to the FieldMask.\\n            e.push(s); else \\n            // For nested and non-empty ObjectValues, add the FieldPath of the\\n            // leaf nodes.\\n            for (const n of t) e.push(s.child(n));\\n        } else \\n        // For nested and non-empty ObjectValues, add the FieldPath of the leaf\\n        // nodes.\\n        e.push(s);\\n    })), new gt(e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a document in Firestore with a key, version, data and whether it\\n * has local mutations applied to it.\\n *\\n * Documents can transition between states via `convertToFoundDocument()`,\\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\\n * not transition to one of these states even after all mutations have been\\n * applied, `isValidDocument()` returns false and the document should be removed\\n * from all views.\\n */ class ne {\\n    constructor(t, e, n, s, i, r) {\\n        this.key = t, this.documentType = e, this.version = n, this.readTime = s, this.data = i, \\n        this.documentState = r;\\n    }\\n    /**\\n     * Creates a document with no known version or data, but which can serve as\\n     * base document for mutations.\\n     */    static newInvalidDocument(t) {\\n        return new ne(t, 0 /* INVALID */ , ct.min(), ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist with the given data at the\\n     * given version.\\n     */    static newFoundDocument(t, e, n) {\\n        return new ne(t, 1 /* FOUND_DOCUMENT */ , e, ct.min(), n, 0 /* SYNCED */);\\n    }\\n    /** Creates a new document that is known to not exist at the given version. */    static newNoDocument(t, e) {\\n        return new ne(t, 2 /* NO_DOCUMENT */ , e, ct.min(), te.empty(), 0 /* SYNCED */);\\n    }\\n    /**\\n     * Creates a new document that is known to exist at the given version but\\n     * whose data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    static newUnknownDocument(t, e) {\\n        return new ne(t, 3 /* UNKNOWN_DOCUMENT */ , e, ct.min(), te.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists and that its version\\n     * and data are known.\\n     */    convertToFoundDocument(t, e) {\\n        return this.version = t, this.documentType = 1 /* FOUND_DOCUMENT */ , this.data = e, \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it doesn't exist at the given\\n     * version.\\n     */    convertToNoDocument(t) {\\n        return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 0 /* SYNCED */ , this;\\n    }\\n    /**\\n     * Changes the document type to indicate that it exists at a given version but\\n     * that its data is not known (e.g. a document that was updated without a known\\n     * base document).\\n     */    convertToUnknownDocument(t) {\\n        return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = te.empty(), \\n        this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasCommittedMutations() {\\n        return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\\n    }\\n    setHasLocalMutations() {\\n        return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;\\n    }\\n    setReadTime(t) {\\n        return this.readTime = t, this;\\n    }\\n    get hasLocalMutations() {\\n        return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;\\n    }\\n    get hasCommittedMutations() {\\n        return 2 /* HAS_COMMITTED_MUTATIONS */ === this.documentState;\\n    }\\n    get hasPendingWrites() {\\n        return this.hasLocalMutations || this.hasCommittedMutations;\\n    }\\n    isValidDocument() {\\n        return 0 /* INVALID */ !== this.documentType;\\n    }\\n    isFoundDocument() {\\n        return 1 /* FOUND_DOCUMENT */ === this.documentType;\\n    }\\n    isNoDocument() {\\n        return 2 /* NO_DOCUMENT */ === this.documentType;\\n    }\\n    isUnknownDocument() {\\n        return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;\\n    }\\n    isEqual(t) {\\n        return t instanceof ne && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);\\n    }\\n    mutableCopy() {\\n        return new ne(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);\\n    }\\n    toString() {\\n        return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;\\n    }\\n}\\n\\n/**\\n * Compares the value for field `field` in the provided documents. Throws if\\n * the field does not exist in both documents.\\n */\\n/**\\n * An index definition for field indexes in Firestore.\\n *\\n * Every index is associated with a collection. The definition contains a list\\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\\n *\\n * Unlike the backend, the SDK does not differentiate between collection or\\n * collection group-scoped indices. Every index can be used for both single\\n * collection and collection group queries.\\n */\\nclass se {\\n    constructor(\\n    /**\\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\\n     * has not yet been persisted).\\n     */\\n    t, \\n    /** The collection ID this index applies to. */\\n    e, \\n    /** The field segments for this index. */\\n    n, \\n    /** Shows how up-to-date the index is for the current user. */\\n    s) {\\n        this.indexId = t, this.collectionGroup = e, this.fields = n, this.indexState = s;\\n    }\\n}\\n\\n/** An ID for an index that has not yet been added to persistence.  */\\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\\nfunction ie(t) {\\n    return t.fields.find((t => 2 /* CONTAINS */ === t.kind));\\n}\\n\\n/** Returns all directional (ascending/descending) segments for this index. */ function re(t) {\\n    return t.fields.filter((t => 2 /* CONTAINS */ !== t.kind));\\n}\\n\\n/**\\n * Returns the order of the document key component for the given index.\\n *\\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\\n */ se.UNKNOWN_ID = -1;\\n\\n/** An index component consisting of field path and index type.  */\\nclass oe {\\n    constructor(\\n    /** The field path of the component. */\\n    t, \\n    /** The fields sorting order. */\\n    e) {\\n        this.fieldPath = t, this.kind = e;\\n    }\\n}\\n\\n/**\\n * Stores the \\\"high water mark\\\" that indicates how updated the Index is for the\\n * current user.\\n */ class ue {\\n    constructor(\\n    /**\\n     * Indicates when the index was last updated (relative to other indexes).\\n     */\\n    t, \\n    /** The the latest indexed read time, document and batch id. */\\n    e) {\\n        this.sequenceNumber = t, this.offset = e;\\n    }\\n    /** The state of an index that has not yet been backfilled. */    static empty() {\\n        return new ue(0, he.min());\\n    }\\n}\\n\\n/**\\n * Creates an offset that matches all documents with a read time higher than\\n * `readTime`.\\n */ function ae(t, e) {\\n    // We want to create an offset that matches all documents with a read time\\n    // greater than the provided read time. To do so, we technically need to\\n    // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\\n    // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\\n    // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\\n    // all valid document IDs.\\n    const n = t.toTimestamp().seconds, s = t.toTimestamp().nanoseconds + 1, i = ct.fromTimestamp(1e9 === s ? new at(n + 1, 0) : new at(n, s));\\n    return new he(i, xt.empty(), e);\\n}\\n\\n/** Creates a new offset based on the provided document. */ function ce(t) {\\n    return new he(t.readTime, t.key, -1);\\n}\\n\\n/**\\n * Stores the latest read time, document and batch ID that were processed for an\\n * index.\\n */ class he {\\n    constructor(\\n    /**\\n     * The latest read time version that has been indexed by Firestore for this\\n     * field index.\\n     */\\n    t, \\n    /**\\n     * The key of the last document that was indexed for this query. Use\\n     * `DocumentKey.empty()` if no document has been indexed.\\n     */\\n    e, \\n    /*\\n     * The largest mutation batch id that's been processed by Firestore.\\n     */\\n    n) {\\n        this.readTime = t, this.documentKey = e, this.largestBatchId = n;\\n    }\\n    /** Returns an offset that sorts before all regular offsets. */    static min() {\\n        return new he(ct.min(), xt.empty(), -1);\\n    }\\n    /** Returns an offset that sorts after all regular offsets. */    static max() {\\n        return new he(ct.max(), xt.empty(), -1);\\n    }\\n}\\n\\nfunction le(t, e) {\\n    let n = t.readTime.compareTo(e.readTime);\\n    return 0 !== n ? n : (n = xt.comparator(t.documentKey, e.documentKey), 0 !== n ? n : rt(t.largestBatchId, e.largestBatchId));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\\n// tree.\\nclass fe {\\n    constructor(t, e) {\\n        this.comparator = t, this.root = e || _e.EMPTY;\\n    }\\n    // Returns a copy of the map, with the specified key/value added or replaced.\\n    insert(t, e) {\\n        return new fe(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns a copy of the map, with the specified key removed.\\n    remove(t) {\\n        return new fe(this.comparator, this.root.remove(t, this.comparator).copy(null, null, _e.BLACK, null, null));\\n    }\\n    // Returns the value of the node with the given key, or null.\\n    get(t) {\\n        let e = this.root;\\n        for (;!e.isEmpty(); ) {\\n            const n = this.comparator(t, e.key);\\n            if (0 === n) return e.value;\\n            n < 0 ? e = e.left : n > 0 && (e = e.right);\\n        }\\n        return null;\\n    }\\n    // Returns the index of the element in this sorted map, or -1 if it doesn't\\n    // exist.\\n    indexOf(t) {\\n        // Number of nodes that were pruned when descending right\\n        let e = 0, n = this.root;\\n        for (;!n.isEmpty(); ) {\\n            const s = this.comparator(t, n.key);\\n            if (0 === s) return e + n.left.size;\\n            s < 0 ? n = n.left : (\\n            // Count all nodes left of the node plus the node itself\\n            e += n.left.size + 1, n = n.right);\\n        }\\n        // Node not found\\n                return -1;\\n    }\\n    isEmpty() {\\n        return this.root.isEmpty();\\n    }\\n    // Returns the total number of nodes in the map.\\n    get size() {\\n        return this.root.size;\\n    }\\n    // Returns the minimum key in the map.\\n    minKey() {\\n        return this.root.minKey();\\n    }\\n    // Returns the maximum key in the map.\\n    maxKey() {\\n        return this.root.maxKey();\\n    }\\n    // Traverses the map in key order and calls the specified action function\\n    // for each key/value pair. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.root.inorderTraversal(t);\\n    }\\n    forEach(t) {\\n        this.inorderTraversal(((e, n) => (t(e, n), !1)));\\n    }\\n    toString() {\\n        const t = [];\\n        return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(\\\", \\\")}}`;\\n    }\\n    // Traverses the map in reverse key order and calls the specified action\\n    // function for each key/value pair. If action returns true, traversal is\\n    // aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.root.reverseTraversal(t);\\n    }\\n    // Returns an iterator over the SortedMap.\\n    getIterator() {\\n        return new de(this.root, null, this.comparator, !1);\\n    }\\n    getIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !1);\\n    }\\n    getReverseIterator() {\\n        return new de(this.root, null, this.comparator, !0);\\n    }\\n    getReverseIteratorFrom(t) {\\n        return new de(this.root, t, this.comparator, !0);\\n    }\\n}\\n\\n // end SortedMap\\n// An iterator over an LLRBNode.\\nclass de {\\n    constructor(t, e, n, s) {\\n        this.isReverse = s, this.nodeStack = [];\\n        let i = 1;\\n        for (;!t.isEmpty(); ) if (i = e ? n(t.key, e) : 1, \\n        // flip the comparison if we're going in reverse\\n        e && s && (i *= -1), i < 0) \\n        // This node is less than our start key. ignore it\\n        t = this.isReverse ? t.left : t.right; else {\\n            if (0 === i) {\\n                // This node is exactly equal to our start key. Push it on the stack,\\n                // but stop iterating;\\n                this.nodeStack.push(t);\\n                break;\\n            }\\n            // This node is greater than our start key, add it to the stack and move\\n            // to the next one\\n            this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;\\n        }\\n    }\\n    getNext() {\\n        let t = this.nodeStack.pop();\\n        const e = {\\n            key: t.key,\\n            value: t.value\\n        };\\n        if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t), \\n        t = t.left;\\n        return e;\\n    }\\n    hasNext() {\\n        return this.nodeStack.length > 0;\\n    }\\n    peek() {\\n        if (0 === this.nodeStack.length) return null;\\n        const t = this.nodeStack[this.nodeStack.length - 1];\\n        return {\\n            key: t.key,\\n            value: t.value\\n        };\\n    }\\n}\\n\\n // end SortedMapIterator\\n// Represents a node in a Left-leaning Red-Black tree.\\nclass _e {\\n    constructor(t, e, n, s, i) {\\n        this.key = t, this.value = e, this.color = null != n ? n : _e.RED, this.left = null != s ? s : _e.EMPTY, \\n        this.right = null != i ? i : _e.EMPTY, this.size = this.left.size + 1 + this.right.size;\\n    }\\n    // Returns a copy of the current node, optionally replacing pieces of it.\\n    copy(t, e, n, s, i) {\\n        return new _e(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != s ? s : this.left, null != i ? i : this.right);\\n    }\\n    isEmpty() {\\n        return !1;\\n    }\\n    // Traverses the tree in key order and calls the specified action function\\n    // for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    inorderTraversal(t) {\\n        return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);\\n    }\\n    // Traverses the tree in reverse key order and calls the specified action\\n    // function for each node. If action returns true, traversal is aborted.\\n    // Returns the first truthy value returned by action, or the last falsey\\n    // value returned by action.\\n    reverseTraversal(t) {\\n        return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);\\n    }\\n    // Returns the minimum node in the tree.\\n    min() {\\n        return this.left.isEmpty() ? this : this.left.min();\\n    }\\n    // Returns the maximum key in the tree.\\n    minKey() {\\n        return this.min().key;\\n    }\\n    // Returns the maximum key in the tree.\\n    maxKey() {\\n        return this.right.isEmpty() ? this.key : this.right.maxKey();\\n    }\\n    // Returns new tree, with the key/value added.\\n    insert(t, e, n) {\\n        let s = this;\\n        const i = n(t, s.key);\\n        return s = i < 0 ? s.copy(null, null, null, s.left.insert(t, e, n), null) : 0 === i ? s.copy(null, e, null, null, null) : s.copy(null, null, null, null, s.right.insert(t, e, n)), \\n        s.fixUp();\\n    }\\n    removeMin() {\\n        if (this.left.isEmpty()) return _e.EMPTY;\\n        let t = this;\\n        return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null), \\n        t.fixUp();\\n    }\\n    // Returns new tree, with the specified item removed.\\n    remove(t, e) {\\n        let n, s = this;\\n        if (e(t, s.key) < 0) s.left.isEmpty() || s.left.isRed() || s.left.left.isRed() || (s = s.moveRedLeft()), \\n        s = s.copy(null, null, null, s.left.remove(t, e), null); else {\\n            if (s.left.isRed() && (s = s.rotateRight()), s.right.isEmpty() || s.right.isRed() || s.right.left.isRed() || (s = s.moveRedRight()), \\n            0 === e(t, s.key)) {\\n                if (s.right.isEmpty()) return _e.EMPTY;\\n                n = s.right.min(), s = s.copy(n.key, n.value, null, null, s.right.removeMin());\\n            }\\n            s = s.copy(null, null, null, null, s.right.remove(t, e));\\n        }\\n        return s.fixUp();\\n    }\\n    isRed() {\\n        return this.color;\\n    }\\n    // Returns new tree after performing any needed rotations.\\n    fixUp() {\\n        let t = this;\\n        return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \\n        t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\\n    }\\n    moveRedLeft() {\\n        let t = this.colorFlip();\\n        return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()), \\n        t = t.rotateLeft(), t = t.colorFlip()), t;\\n    }\\n    moveRedRight() {\\n        let t = this.colorFlip();\\n        return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;\\n    }\\n    rotateLeft() {\\n        const t = this.copy(null, null, _e.RED, null, this.right.left);\\n        return this.right.copy(null, null, this.color, t, null);\\n    }\\n    rotateRight() {\\n        const t = this.copy(null, null, _e.RED, this.left.right, null);\\n        return this.left.copy(null, null, this.color, null, t);\\n    }\\n    colorFlip() {\\n        const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);\\n        return this.copy(null, null, !this.color, t, e);\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        const t = this.check();\\n        return Math.pow(2, t) <= this.size + 1;\\n    }\\n    // In a balanced RB tree, the black-depth (number of black nodes) from root to\\n    // leaves is equal on both sides.  This function verifies that or asserts.\\n    check() {\\n        if (this.isRed() && this.left.isRed()) throw L();\\n        if (this.right.isRed()) throw L();\\n        const t = this.left.check();\\n        if (t !== this.right.check()) throw L();\\n        return t + (this.isRed() ? 0 : 1);\\n    }\\n}\\n\\n // end LLRBNode\\n// Empty node is shared between all LLRB trees.\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\n_e.EMPTY = null, _e.RED = !0, _e.BLACK = !1;\\n\\n// end LLRBEmptyNode\\n_e.EMPTY = new \\n// Represents an empty node (a leaf node in the Red-Black Tree).\\nclass {\\n    constructor() {\\n        this.size = 0;\\n    }\\n    get key() {\\n        throw L();\\n    }\\n    get value() {\\n        throw L();\\n    }\\n    get color() {\\n        throw L();\\n    }\\n    get left() {\\n        throw L();\\n    }\\n    get right() {\\n        throw L();\\n    }\\n    // Returns a copy of the current node.\\n    copy(t, e, n, s, i) {\\n        return this;\\n    }\\n    // Returns a copy of the tree, with the specified key/value added.\\n    insert(t, e, n) {\\n        return new _e(t, e);\\n    }\\n    // Returns a copy of the tree, with the specified key removed.\\n    remove(t, e) {\\n        return this;\\n    }\\n    isEmpty() {\\n        return !0;\\n    }\\n    inorderTraversal(t) {\\n        return !1;\\n    }\\n    reverseTraversal(t) {\\n        return !1;\\n    }\\n    minKey() {\\n        return null;\\n    }\\n    maxKey() {\\n        return null;\\n    }\\n    isRed() {\\n        return !1;\\n    }\\n    // For testing.\\n    checkMaxDepth() {\\n        return !0;\\n    }\\n    check() {\\n        return 0;\\n    }\\n};\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * SortedSet is an immutable (copy-on-write) collection that holds elements\\n * in order specified by the provided comparator.\\n *\\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\\n * be equal!\\n */\\nclass we {\\n    constructor(t) {\\n        this.comparator = t, this.data = new fe(this.comparator);\\n    }\\n    has(t) {\\n        return null !== this.data.get(t);\\n    }\\n    first() {\\n        return this.data.minKey();\\n    }\\n    last() {\\n        return this.data.maxKey();\\n    }\\n    get size() {\\n        return this.data.size;\\n    }\\n    indexOf(t) {\\n        return this.data.indexOf(t);\\n    }\\n    /** Iterates elements in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.data.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */    forEachInRange(t, e) {\\n        const n = this.data.getIteratorFrom(t[0]);\\n        for (;n.hasNext(); ) {\\n            const s = n.getNext();\\n            if (this.comparator(s.key, t[1]) >= 0) return;\\n            e(s.key);\\n        }\\n    }\\n    /**\\n     * Iterates over `elem`s such that: start &lt;= elem until false is returned.\\n     */    forEachWhile(t, e) {\\n        let n;\\n        for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {\\n            if (!t(n.getNext().key)) return;\\n        }\\n    }\\n    /** Finds the least element greater than or equal to `elem`. */    firstAfterOrEqual(t) {\\n        const e = this.data.getIteratorFrom(t);\\n        return e.hasNext() ? e.getNext().key : null;\\n    }\\n    getIterator() {\\n        return new me(this.data.getIterator());\\n    }\\n    getIteratorFrom(t) {\\n        return new me(this.data.getIteratorFrom(t));\\n    }\\n    /** Inserts or updates an element */    add(t) {\\n        return this.copy(this.data.remove(t).insert(t, !0));\\n    }\\n    /** Deletes an element */    delete(t) {\\n        return this.has(t) ? this.copy(this.data.remove(t)) : this;\\n    }\\n    isEmpty() {\\n        return this.data.isEmpty();\\n    }\\n    unionWith(t) {\\n        let e = this;\\n        // Make sure `result` always refers to the larger one of the two sets.\\n                return e.size < t.size && (e = t, t = this), t.forEach((t => {\\n            e = e.add(t);\\n        })), e;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof we)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.data.getIterator(), n = t.data.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (0 !== this.comparator(t, s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toArray() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e);\\n        })), t;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), \\\"SortedSet(\\\" + t.toString() + \\\")\\\";\\n    }\\n    copy(t) {\\n        const e = new we(this.comparator);\\n        return e.data = t, e;\\n    }\\n}\\n\\nclass me {\\n    constructor(t) {\\n        this.iter = t;\\n    }\\n    getNext() {\\n        return this.iter.getNext().key;\\n    }\\n    hasNext() {\\n        return this.iter.hasNext();\\n    }\\n}\\n\\n/**\\n * Compares two sorted sets for equality using their natural ordering. The\\n * method computes the intersection and invokes `onAdd` for every element that\\n * is in `after` but not `before`. `onRemove` is invoked for every element in\\n * `before` but missing from `after`.\\n *\\n * The method creates a copy of both `before` and `after` and runs in O(n log\\n * n), where n is the size of the two lists.\\n *\\n * @param before - The elements that exist in the original set.\\n * @param after - The elements to diff against the original set.\\n * @param comparator - The comparator for the elements in before and after.\\n * @param onAdd - A function to invoke for every element that is part of `\\n * after` but not `before`.\\n * @param onRemove - A function to invoke for every element that is part of\\n * `before` but not `after`.\\n */\\n/**\\n * Returns the next element from the iterator or `undefined` if none available.\\n */\\nfunction ge(t) {\\n    return t.hasNext() ? t.getNext() : void 0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Visible for testing\\nclass ye {\\n    constructor(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n        this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = s, this.limit = i, \\n        this.startAt = r, this.endAt = o, this.P = null;\\n    }\\n}\\n\\n/**\\n * Initializes a Target with a path and optional additional query constraints.\\n * Path must currently be empty if this is a collection group query.\\n *\\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\\n * using this factory method, because `Query` provides an implicit `orderBy`\\n * property.\\n */ function pe(t, e = null, n = [], s = [], i = null, r = null, o = null) {\\n    return new ye(t, e, n, s, i, r, o);\\n}\\n\\nfunction Ie(t) {\\n    const e = K(t);\\n    if (null === e.P) {\\n        let t = e.path.canonicalString();\\n        null !== e.collectionGroup && (t += \\\"|cg:\\\" + e.collectionGroup), t += \\\"|f:\\\", t += e.filters.map((t => {\\n            return (e = t).field.canonicalString() + e.op.toString() + Lt(e.value);\\n            var e;\\n        })).join(\\\",\\\"), t += \\\"|ob:\\\", t += e.orderBy.map((t => function(t) {\\n            // TODO(b/29183165): Make this collision robust.\\n            return t.field.canonicalString() + t.dir;\\n        }(t))).join(\\\",\\\"), St(e.limit) || (t += \\\"|l:\\\", t += e.limit), e.startAt && (t += \\\"|lb:\\\", \\n        t += e.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", t += e.startAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.endAt && (t += \\\"|ub:\\\", t += e.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", t += e.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n        e.P = t;\\n    }\\n    return e.P;\\n}\\n\\nfunction Te(t) {\\n    let e = t.path.canonicalString();\\n    return null !== t.collectionGroup && (e += \\\" collectionGroup=\\\" + t.collectionGroup), \\n    t.filters.length > 0 && (e += `, filters: [${t.filters.map((t => {\\n        return `${(e = t).field.canonicalString()} ${e.op} ${Lt(e.value)}`;\\n        /** Returns a debug description for `filter`. */\\n        var e;\\n        /** Filter that matches on key fields (i.e. '__name__'). */    })).join(\\\", \\\")}]`), \\n    St(t.limit) || (e += \\\", limit: \\\" + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {\\n        return `${t.field.canonicalString()} (${t.dir})`;\\n    }(t))).join(\\\", \\\")}]`), t.startAt && (e += \\\", startAt: \\\", e += t.startAt.inclusive ? \\\"b:\\\" : \\\"a:\\\", \\n    e += t.startAt.position.map((t => Lt(t))).join(\\\",\\\")), t.endAt && (e += \\\", endAt: \\\", \\n    e += t.endAt.inclusive ? \\\"a:\\\" : \\\"b:\\\", e += t.endAt.position.map((t => Lt(t))).join(\\\",\\\")), \\n    `Target(${e})`;\\n}\\n\\nfunction Ee(t, e) {\\n    if (t.limit !== e.limit) return !1;\\n    if (t.orderBy.length !== e.orderBy.length) return !1;\\n    for (let n = 0; n < t.orderBy.length; n++) if (!$e(t.orderBy[n], e.orderBy[n])) return !1;\\n    if (t.filters.length !== e.filters.length) return !1;\\n    for (let i = 0; i < t.filters.length; i++) if (n = t.filters[i], s = e.filters[i], \\n    n.op !== s.op || !n.field.isEqual(s.field) || !Ot(n.value, s.value)) return !1;\\n    var n, s;\\n    return t.collectionGroup === e.collectionGroup && (!!t.path.isEqual(e.path) && (!!Le(t.startAt, e.startAt) && Le(t.endAt, e.endAt)));\\n}\\n\\nfunction Ae(t) {\\n    return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n}\\n\\n/** Returns the field filters that target the given field path. */ function Re(t, e) {\\n    return t.filters.filter((t => t instanceof Ve && t.field.isEqual(e)));\\n}\\n\\n/**\\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\\n * filters. Returns `null` if there are no such filters.\\n */\\n/**\\n * Returns the value to use as the lower bound for ascending index segment at\\n * the provided `fieldPath` (or the upper bound for an descending segment).\\n */\\nfunction be(t, e, n) {\\n    let s = kt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = kt, e = !0;\\n        switch (n.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = Jt(n.value);\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = kt;\\n // Remaining filters cannot be used as lower bounds.\\n                }\\n        Xt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) < 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Xt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) < 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/**\\n * Returns the value to use as the upper bound for ascending index segment at\\n * the provided `fieldPath` (or the lower bound for a descending segment).\\n */ function Pe(t, e, n) {\\n    let s = Nt, i = !0;\\n    // Process all filters to find a value for the current field segment\\n    for (const n of Re(t, e)) {\\n        let t = Nt, e = !0;\\n        switch (n.op) {\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            t = Yt(n.value), e = !1;\\n            break;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n          case \\\"in\\\" /* IN */ :\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            t = n.value;\\n            break;\\n\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            t = n.value, e = !1;\\n            break;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n          case \\\"not-in\\\" /* NOT_IN */ :\\n            t = Nt;\\n // Remaining filters cannot be used as upper bounds.\\n                }\\n        Zt({\\n            value: s,\\n            inclusive: i\\n        }, {\\n            value: t,\\n            inclusive: e\\n        }) > 0 && (s = t, i = e);\\n    }\\n    // If there is an additional bound, compare the values against the existing\\n    // range to see if we can narrow the scope.\\n        if (null !== n) for (let r = 0; r < t.orderBy.length; ++r) {\\n        if (t.orderBy[r].field.isEqual(e)) {\\n            const t = n.position[r];\\n            Zt({\\n                value: s,\\n                inclusive: i\\n            }, {\\n                value: t,\\n                inclusive: n.inclusive\\n            }) > 0 && (s = t, i = n.inclusive);\\n            break;\\n        }\\n    }\\n    return {\\n        value: s,\\n        inclusive: i\\n    };\\n}\\n\\n/** Returns the number of segments of a perfect index for this target. */ class Ve extends class {} {\\n    constructor(t, e, n) {\\n        super(), this.field = t, this.op = e, this.value = n;\\n    }\\n    /**\\n     * Creates a filter based on the provided arguments.\\n     */    static create(t, e, n) {\\n        return t.isKeyField() ? \\\"in\\\" /* IN */ === e || \\\"not-in\\\" /* NOT_IN */ === e ? this.V(t, e, n) : new ve(t, e, n) : \\\"array-contains\\\" /* ARRAY_CONTAINS */ === e ? new xe(t, n) : \\\"in\\\" /* IN */ === e ? new Ne(t, n) : \\\"not-in\\\" /* NOT_IN */ === e ? new ke(t, n) : \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === e ? new Me(t, n) : new Ve(t, e, n);\\n    }\\n    static V(t, e, n) {\\n        return \\\"in\\\" /* IN */ === e ? new Se(t, n) : new De(t, n);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        // Types do not have to match in NOT_EQUAL filters.\\n                return \\\"!=\\\" /* NOT_EQUAL */ === this.op ? null !== e && this.v($t(e, this.value)) : null !== e && Mt(this.value) === Mt(e) && this.v($t(e, this.value));\\n        // Only compare types with matching backend order (such as double and int).\\n        }\\n    v(t) {\\n        switch (this.op) {\\n          case \\\"<\\\" /* LESS_THAN */ :\\n            return t < 0;\\n\\n          case \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ :\\n            return t <= 0;\\n\\n          case \\\"==\\\" /* EQUAL */ :\\n            return 0 === t;\\n\\n          case \\\"!=\\\" /* NOT_EQUAL */ :\\n            return 0 !== t;\\n\\n          case \\\">\\\" /* GREATER_THAN */ :\\n            return t > 0;\\n\\n          case \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ :\\n            return t >= 0;\\n\\n          default:\\n            return L();\\n        }\\n    }\\n    S() {\\n        return [ \\\"<\\\" /* LESS_THAN */ , \\\"<=\\\" /* LESS_THAN_OR_EQUAL */ , \\\">\\\" /* GREATER_THAN */ , \\\">=\\\" /* GREATER_THAN_OR_EQUAL */ , \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ].indexOf(this.op) >= 0;\\n    }\\n}\\n\\nclass ve extends Ve {\\n    constructor(t, e, n) {\\n        super(t, e, n), this.key = xt.fromName(n.referenceValue);\\n    }\\n    matches(t) {\\n        const e = xt.comparator(t.key, this.key);\\n        return this.v(e);\\n    }\\n}\\n\\n/** Filter that matches on key fields within an array. */ class Se extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e), this.keys = Ce(\\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        return this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\n/** Filter that matches on key fields not present within an array. */ class De extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e), this.keys = Ce(\\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        return !this.keys.some((e => e.isEqual(t.key)));\\n    }\\n}\\n\\nfunction Ce(t, e) {\\n    var n;\\n    return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => xt.fromName(t.referenceValue)));\\n}\\n\\n/** A Filter that implements the array-contains operator. */ class xe extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains\\\" /* ARRAY_CONTAINS */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return Gt(e) && Ft(e.arrayValue, this.value);\\n    }\\n}\\n\\n/** A Filter that implements the IN operator. */ class Ne extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"in\\\" /* IN */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return null !== e && Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the not-in operator. */ class ke extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"not-in\\\" /* NOT_IN */ , e);\\n    }\\n    matches(t) {\\n        if (Ft(this.value.arrayValue, {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        })) return !1;\\n        const e = t.data.field(this.field);\\n        return null !== e && !Ft(this.value.arrayValue, e);\\n    }\\n}\\n\\n/** A Filter that implements the array-contains-any operator. */ class Me extends Ve {\\n    constructor(t, e) {\\n        super(t, \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , e);\\n    }\\n    matches(t) {\\n        const e = t.data.field(this.field);\\n        return !(!Gt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Ft(this.value.arrayValue, t)));\\n    }\\n}\\n\\n/**\\n * Represents a bound of a query.\\n *\\n * The bound is specified with the given components representing a position and\\n * whether it's just before or just after the position (relative to whatever the\\n * query order is).\\n *\\n * The position represents a logical index position for a query. It's a prefix\\n * of values for the (potentially implicit) order by clauses of a query.\\n *\\n * Bound provides a function to determine whether a document comes before or\\n * after a bound. This is influenced by whether the position is just before or\\n * just after the provided values.\\n */ class Oe {\\n    constructor(t, e) {\\n        this.position = t, this.inclusive = e;\\n    }\\n}\\n\\n/**\\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\\n */ class Fe {\\n    constructor(t, e = \\\"asc\\\" /* ASCENDING */) {\\n        this.field = t, this.dir = e;\\n    }\\n}\\n\\nfunction $e(t, e) {\\n    return t.dir === e.dir && t.field.isEqual(e.field);\\n}\\n\\nfunction Be(t, e, n) {\\n    let s = 0;\\n    for (let i = 0; i < t.position.length; i++) {\\n        const r = e[i], o = t.position[i];\\n        if (r.field.isKeyField()) s = xt.comparator(xt.fromName(o.referenceValue), n.key); else {\\n            s = $t(o, n.data.field(r.field));\\n        }\\n        if (\\\"desc\\\" /* DESCENDING */ === r.dir && (s *= -1), 0 !== s) break;\\n    }\\n    return s;\\n}\\n\\n/**\\n * Returns true if a document sorts after a bound using the provided sort\\n * order.\\n */ function Le(t, e) {\\n    if (null === t) return null === e;\\n    if (null === e) return !1;\\n    if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;\\n    for (let n = 0; n < t.position.length; n++) {\\n        if (!Ot(t.position[n], e.position[n])) return !1;\\n    }\\n    return !0;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Query encapsulates all the query attributes we support in the SDK. It can\\n * be run against the LocalStore, as well as be converted to a `Target` to\\n * query the RemoteStore results.\\n *\\n * Visible for testing.\\n */ class Ue {\\n    /**\\n     * Initializes a Query with a path and optional additional query constraints.\\n     * Path must currently be empty if this is a collection group query.\\n     */\\n    constructor(t, e = null, n = [], s = [], i = null, r = \\\"F\\\" /* First */ , o = null, u = null) {\\n        this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, \\n        this.limit = i, this.limitType = r, this.startAt = o, this.endAt = u, this.D = null, \\n        // The corresponding `Target` of this `Query` instance.\\n        this.C = null, this.startAt, this.endAt;\\n    }\\n}\\n\\n/** Creates a new Query instance with the options provided. */ function qe(t, e, n, s, i, r, o, u) {\\n    return new Ue(t, e, n, s, i, r, o, u);\\n}\\n\\n/** Creates a new Query for a query that matches all documents at `path` */ function Ke(t) {\\n    return new Ue(t);\\n}\\n\\n/**\\n * Helper to convert a collection group query into a collection query at a\\n * specific path. This is used when executing collection group queries, since\\n * we have to split the query into a set of collection queries at multiple\\n * paths.\\n */\\n/**\\n * Returns true if this query does not specify any query constraints that\\n * could remove results.\\n */\\nfunction Ge(t) {\\n    return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());\\n}\\n\\nfunction Qe(t) {\\n    return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;\\n}\\n\\nfunction je(t) {\\n    for (const e of t.filters) if (e.S()) return e.field;\\n    return null;\\n}\\n\\n/**\\n * Checks if any of the provided Operators are included in the query and\\n * returns the first one that is, or null if none are.\\n */\\n/**\\n * Returns whether the query matches a collection group rather than a specific\\n * collection.\\n */\\nfunction We(t) {\\n    return null !== t.collectionGroup;\\n}\\n\\n/**\\n * Returns the implicit order by constraint that is used to execute the Query,\\n * which can be different from the order by constraints the user provided (e.g.\\n * the SDK and backend always orders by `__name__`).\\n */ function ze(t) {\\n    const e = K(t);\\n    if (null === e.D) {\\n        e.D = [];\\n        const t = je(e), n = Qe(e);\\n        if (null !== t && null === n) \\n        // In order to implicitly add key ordering, we must also add the\\n        // inequality filter field for it to be a valid query.\\n        // Note that the default inequality field and key ordering is ascending.\\n        t.isKeyField() || e.D.push(new Fe(t)), e.D.push(new Fe(mt.keyField(), \\\"asc\\\" /* ASCENDING */)); else {\\n            let t = !1;\\n            for (const n of e.explicitOrderBy) e.D.push(n), n.field.isKeyField() && (t = !0);\\n            if (!t) {\\n                // The order of the implicit key ordering always matches the last\\n                // explicit order by\\n                const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : \\\"asc\\\" /* ASCENDING */;\\n                e.D.push(new Fe(mt.keyField(), t));\\n            }\\n        }\\n    }\\n    return e.D;\\n}\\n\\n/**\\n * Converts this `Query` instance to it's corresponding `Target` representation.\\n */ function He(t) {\\n    const e = K(t);\\n    if (!e.C) if (\\\"F\\\" /* First */ === e.limitType) e.C = pe(e.path, e.collectionGroup, ze(e), e.filters, e.limit, e.startAt, e.endAt); else {\\n        // Flip the orderBy directions since we want the last results\\n        const t = [];\\n        for (const n of ze(e)) {\\n            const e = \\\"desc\\\" /* DESCENDING */ === n.dir ? \\\"asc\\\" /* ASCENDING */ : \\\"desc\\\" /* DESCENDING */;\\n            t.push(new Fe(n.field, e));\\n        }\\n        // We need to swap the cursors to match the now-flipped query ordering.\\n                const n = e.endAt ? new Oe(e.endAt.position, e.endAt.inclusive) : null, s = e.startAt ? new Oe(e.startAt.position, e.startAt.inclusive) : null;\\n        // Now return as a LimitType.First query.\\n        e.C = pe(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);\\n    }\\n    return e.C;\\n}\\n\\nfunction Je(t, e, n) {\\n    return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);\\n}\\n\\nfunction Ye(t, e) {\\n    return Ee(He(t), He(e)) && t.limitType === e.limitType;\\n}\\n\\n// TODO(b/29183165): This is used to get a unique string from a query to, for\\n// example, use as a dictionary key, but the implementation is subject to\\n// collisions. Make it collision-free.\\nfunction Xe(t) {\\n    return `${Ie(He(t))}|lt:${t.limitType}`;\\n}\\n\\nfunction Ze(t) {\\n    return `Query(target=${Te(He(t))}; limitType=${t.limitType})`;\\n}\\n\\n/** Returns whether `doc` matches the constraints of `query`. */ function tn(t, e) {\\n    return e.isFoundDocument() && function(t, e) {\\n        const n = e.key.path;\\n        return null !== t.collectionGroup ? e.key.hasCollectionId(t.collectionGroup) && t.path.isPrefixOf(n) : xt.isDocumentKey(t.path) ? t.path.isEqual(n) : t.path.isImmediateParentOf(n);\\n    }\\n    /**\\n * A document must have a value for every ordering clause in order to show up\\n * in the results.\\n */ (t, e) && function(t, e) {\\n        for (const n of t.explicitOrderBy) \\n        // order by key always matches\\n        if (!n.field.isKeyField() && null === e.data.field(n.field)) return !1;\\n        return !0;\\n    }(t, e) && function(t, e) {\\n        for (const n of t.filters) if (!n.matches(e)) return !1;\\n        return !0;\\n    }\\n    /** Makes sure a document is within the bounds, if provided. */ (t, e) && function(t, e) {\\n        if (t.startAt && !\\n        /**\\n * Returns true if a document sorts before a bound using the provided sort\\n * order.\\n */\\n        function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s <= 0 : s < 0;\\n        }(t.startAt, ze(t), e)) return !1;\\n        if (t.endAt && !function(t, e, n) {\\n            const s = Be(t, e, n);\\n            return t.inclusive ? s >= 0 : s > 0;\\n        }(t.endAt, ze(t), e)) return !1;\\n        return !0;\\n    }\\n    /**\\n * Returns the collection group that this query targets.\\n *\\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\\n * synchronization for query results.\\n */ (t, e);\\n}\\n\\nfunction en(t) {\\n    return t.collectionGroup || (t.path.length % 2 == 1 ? t.path.lastSegment() : t.path.get(t.path.length - 2));\\n}\\n\\n/**\\n * Returns a new comparator function that can be used to compare two documents\\n * based on the Query's ordering constraint.\\n */ function nn(t) {\\n    return (e, n) => {\\n        let s = !1;\\n        for (const i of ze(t)) {\\n            const t = sn(i, e, n);\\n            if (0 !== t) return t;\\n            s = s || i.field.isKeyField();\\n        }\\n        return 0;\\n    };\\n}\\n\\nfunction sn(t, e, n) {\\n    const s = t.field.isKeyField() ? xt.comparator(e.key, n.key) : function(t, e, n) {\\n        const s = e.data.field(t), i = n.data.field(t);\\n        return null !== s && null !== i ? $t(s, i) : L();\\n    }\\n    /**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * The initial mutation batch id for each index. Gets updated during index\\n * backfill.\\n */ (t.field, e, n);\\n    switch (t.dir) {\\n      case \\\"asc\\\" /* ASCENDING */ :\\n        return s;\\n\\n      case \\\"desc\\\" /* DESCENDING */ :\\n        return -1 * s;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns an DoubleValue for `value` that is encoded based the serializer's\\n * `useProto3Json` setting.\\n */ function rn(t, e) {\\n    if (t.N) {\\n        if (isNaN(e)) return {\\n            doubleValue: \\\"NaN\\\"\\n        };\\n        if (e === 1 / 0) return {\\n            doubleValue: \\\"Infinity\\\"\\n        };\\n        if (e === -1 / 0) return {\\n            doubleValue: \\\"-Infinity\\\"\\n        };\\n    }\\n    return {\\n        doubleValue: Dt(e) ? \\\"-0\\\" : e\\n    };\\n}\\n\\n/**\\n * Returns an IntegerValue for `value`.\\n */ function on(t) {\\n    return {\\n        integerValue: \\\"\\\" + t\\n    };\\n}\\n\\n/**\\n * Returns a value for a number that's appropriate to put into a proto.\\n * The return value is an IntegerValue if it can safely represent the value,\\n * otherwise a DoubleValue is returned.\\n */ function un(t, e) {\\n    return Ct(e) ? on(e) : rn(t, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Used to represent a field transform on a mutation. */ class an {\\n    constructor() {\\n        // Make sure that the structural type of `TransformOperation` is unique.\\n        // See https://github.com/microsoft/TypeScript/issues/5451\\n        this._ = void 0;\\n    }\\n}\\n\\n/**\\n * Computes the local transform result against the provided `previousValue`,\\n * optionally using the provided localWriteTime.\\n */ function cn(t, e, n) {\\n    return t instanceof fn ? function(t, e) {\\n        const n = {\\n            fields: {\\n                __type__: {\\n                    stringValue: \\\"server_timestamp\\\"\\n                },\\n                __local_write_time__: {\\n                    timestampValue: {\\n                        seconds: t.seconds,\\n                        nanos: t.nanoseconds\\n                    }\\n                }\\n            }\\n        };\\n        return e && (n.fields.__previous_value__ = e), {\\n            mapValue: n\\n        };\\n    }(n, e) : t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : function(t, e) {\\n        // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\\n        // precision and resolves overflows by reducing precision, we do not\\n        // manually cap overflows at 2^63.\\n        const n = ln(t, e), s = yn(n) + yn(t.k);\\n        return Kt(n) && Kt(t.k) ? on(s) : rn(t.M, s);\\n    }(t, e);\\n}\\n\\n/**\\n * Computes a final transform result after the transform has been acknowledged\\n * by the server, potentially using the server-provided transformResult.\\n */ function hn(t, e, n) {\\n    // The server just sends null as the transform result for array operations,\\n    // so we have to calculate a result the same as we do for local\\n    // applications.\\n    return t instanceof dn ? _n(t, e) : t instanceof wn ? mn(t, e) : n;\\n}\\n\\n/**\\n * If this transform operation is not idempotent, returns the base value to\\n * persist for this transform. If a base value is returned, the transform\\n * operation is always applied to this base value, even if document has\\n * already been updated.\\n *\\n * Base values provide consistent behavior for non-idempotent transforms and\\n * allow us to return the same latency-compensated value even if the backend\\n * has already applied the transform operation. The base value is null for\\n * idempotent transforms, as they can be re-played even if the backend has\\n * already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent transforms.\\n */ function ln(t, e) {\\n    return t instanceof gn ? Kt(n = e) || function(t) {\\n        return !!t && \\\"doubleValue\\\" in t;\\n    }\\n    /** Returns true if `value` is either an IntegerValue or a DoubleValue. */ (n) ? e : {\\n        integerValue: 0\\n    } : null;\\n    var n;\\n}\\n\\n/** Transforms a value into a server-generated timestamp. */\\nclass fn extends an {}\\n\\n/** Transforms an array value via a union operation. */ class dn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction _n(t, e) {\\n    const n = pn(e);\\n    for (const e of t.elements) n.some((t => Ot(t, e))) || n.push(e);\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/** Transforms an array value via a remove operation. */ class wn extends an {\\n    constructor(t) {\\n        super(), this.elements = t;\\n    }\\n}\\n\\nfunction mn(t, e) {\\n    let n = pn(e);\\n    for (const e of t.elements) n = n.filter((t => !Ot(t, e)));\\n    return {\\n        arrayValue: {\\n            values: n\\n        }\\n    };\\n}\\n\\n/**\\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\\n * transforms. Converts all field values to integers or doubles, but unlike the\\n * backend does not cap integer values at 2^63. Instead, JavaScript number\\n * arithmetic is used and precision loss can occur for values greater than 2^53.\\n */ class gn extends an {\\n    constructor(t, e) {\\n        super(), this.M = t, this.k = e;\\n    }\\n}\\n\\nfunction yn(t) {\\n    return Et(t.integerValue || t.doubleValue);\\n}\\n\\nfunction pn(t) {\\n    return Gt(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A field path and the TransformOperation to perform upon it. */ class In {\\n    constructor(t, e) {\\n        this.field = t, this.transform = e;\\n    }\\n}\\n\\nfunction Tn(t, e) {\\n    return t.field.isEqual(e.field) && function(t, e) {\\n        return t instanceof dn && e instanceof dn || t instanceof wn && e instanceof wn ? ot(t.elements, e.elements, Ot) : t instanceof gn && e instanceof gn ? Ot(t.k, e.k) : t instanceof fn && e instanceof fn;\\n    }(t.transform, e.transform);\\n}\\n\\n/** The result of successfully applying a mutation to the backend. */\\nclass En {\\n    constructor(\\n    /**\\n     * The version at which the mutation was committed:\\n     *\\n     * - For most operations, this is the updateTime in the WriteResult.\\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\\n     *   not stored and have no updateTime).\\n     *\\n     * Note that these versions can be different: No-op writes will not change\\n     * the updateTime even though the commitTime advances.\\n     */\\n    t, \\n    /**\\n     * The resulting fields returned from the backend after a mutation\\n     * containing field transforms has been committed. Contains one FieldValue\\n     * for each FieldTransform that was in the mutation.\\n     *\\n     * Will be empty if the mutation did not contain any field transforms.\\n     */\\n    e) {\\n        this.version = t, this.transformResults = e;\\n    }\\n}\\n\\n/**\\n * Encodes a precondition for a mutation. This follows the model that the\\n * backend accepts with the special case of an explicit \\\"empty\\\" precondition\\n * (meaning no precondition).\\n */ class An {\\n    constructor(t, e) {\\n        this.updateTime = t, this.exists = e;\\n    }\\n    /** Creates a new empty Precondition. */    static none() {\\n        return new An;\\n    }\\n    /** Creates a new Precondition with an exists flag. */    static exists(t) {\\n        return new An(void 0, t);\\n    }\\n    /** Creates a new Precondition based on a version a document exists at. */    static updateTime(t) {\\n        return new An(t);\\n    }\\n    /** Returns whether this Precondition is empty. */    get isNone() {\\n        return void 0 === this.updateTime && void 0 === this.exists;\\n    }\\n    isEqual(t) {\\n        return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);\\n    }\\n}\\n\\n/** Returns true if the preconditions is valid for the given document. */ function Rn(t, e) {\\n    return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\\n}\\n\\n/**\\n * A mutation describes a self-contained change to a document. Mutations can\\n * create, replace, delete, and update subsets of documents.\\n *\\n * Mutations not only act on the value of the document but also its version.\\n *\\n * For local mutations (mutations that haven't been committed yet), we preserve\\n * the existing version for Set and Patch mutations. For Delete mutations, we\\n * reset the version to 0.\\n *\\n * Here's the expected transition table.\\n *\\n * MUTATION           APPLIED TO            RESULTS IN\\n *\\n * SetMutation        Document(v3)          Document(v3)\\n * SetMutation        NoDocument(v3)        Document(v0)\\n * SetMutation        InvalidDocument(v0)   Document(v0)\\n * PatchMutation      Document(v3)          Document(v3)\\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\\n * DeleteMutation     Document(v3)          NoDocument(v0)\\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\\n *\\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\\n * the resulting version for Set and Patch mutations. As deletes have no\\n * explicit update time, we use the commitTime of the WriteResponse for\\n * Delete mutations.\\n *\\n * If a mutation is acknowledged by the backend but fails the precondition check\\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\\n * the updated version.\\n *\\n * Field transforms are used only with Patch and Set Mutations. We use the\\n * `updateTransforms` message to store transforms, rather than the `transforms`s\\n * messages.\\n *\\n * ## Subclassing Notes\\n *\\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\\n * applyToLocalView() to implement the actual behavior of applying the mutation\\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\\n * example).\\n */ class bn {}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing a\\n * new remote document. If the input document doesn't match the expected state\\n * (e.g. it is invalid or outdated), the document type may transition to\\n * unknown.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param mutationResult - The result of applying the mutation from the backend.\\n */ function Pn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\\n        // remote document the server has accepted the mutation so the precondition\\n        // must have held.\\n        const s = t.value.clone(), i = kn(t.fieldTransforms, e, n.transformResults);\\n        s.setAll(i), e.convertToFoundDocument(n.version, s).setHasCommittedMutations();\\n    }(t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // Since the mutation was not rejected, we know that the precondition\\n        // matched on the backend. We therefore must not have the expected version\\n        // of the document in our cache and convert to an UnknownDocument with a\\n        // known updateTime.\\n        return void e.convertToUnknownDocument(n.version);\\n        const s = kn(t.fieldTransforms, e, n.transformResults), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();\\n    }(t, e, n) : function(t, e, n) {\\n        // Unlike applyToLocalView, if we're applying a mutation to a remote\\n        // document the server has accepted the mutation so the precondition must\\n        // have held.\\n        e.convertToNoDocument(n.version).setHasCommittedMutations();\\n    }(0, e, n);\\n}\\n\\n/**\\n * Applies this mutation to the given document for the purposes of computing\\n * the new local view of a document. If the input document doesn't match the\\n * expected state, the document is not modified.\\n *\\n * @param mutation - The mutation to apply.\\n * @param document - The document to mutate. The input document can be an\\n *     invalid document if the client has no knowledge of the pre-mutation state\\n *     of the document.\\n * @param localWriteTime - A timestamp indicating the local write time of the\\n *     batch this mutation is a part of.\\n */ function Vn(t, e, n) {\\n    t instanceof Cn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) \\n        // The mutation failed to apply (e.g. a document ID created with add()\\n        // caused a name collision).\\n        return;\\n        const s = t.value.clone(), i = Mn(t.fieldTransforms, n, e);\\n        s.setAll(i), e.convertToFoundDocument(Dn(e), s).setHasLocalMutations();\\n    }\\n    /**\\n * A mutation that modifies fields of the document at the given key with the\\n * given values. The values are applied through a field mask:\\n *\\n *  * When a field is in both the mask and the values, the corresponding field\\n *    is updated.\\n *  * When a field is in neither the mask nor the values, the corresponding\\n *    field is unmodified.\\n *  * When a field is in the mask but not in the values, the corresponding field\\n *    is deleted.\\n *  * When a field is not in the mask but is in the values, the values map is\\n *    ignored.\\n */ (t, e, n) : t instanceof xn ? function(t, e, n) {\\n        if (!Rn(t.precondition, e)) return;\\n        const s = Mn(t.fieldTransforms, n, e), i = e.data;\\n        i.setAll(Nn(t)), i.setAll(s), e.convertToFoundDocument(Dn(e), i).setHasLocalMutations();\\n    }\\n    /**\\n * Returns a FieldPath/Value map with the content of the PatchMutation.\\n */ (t, e, n) : function(t, e) {\\n        Rn(t.precondition, e) && \\n        // We don't call `setHasLocalMutations()` since we want to be backwards\\n        // compatible with the existing SDK behavior.\\n        e.convertToNoDocument(ct.min());\\n    }\\n    /**\\n * A mutation that verifies the existence of the document at the given key with\\n * the provided precondition.\\n *\\n * The `verify` operation is only used in Transactions, and this class serves\\n * primarily to facilitate serialization into protos.\\n */ (t, e);\\n}\\n\\n/**\\n * If this mutation is not idempotent, returns the base value to persist with\\n * this mutation. If a base value is returned, the mutation is always applied\\n * to this base value, even if document has already been updated.\\n *\\n * The base value is a sparse object that consists of only the document\\n * fields for which this mutation contains a non-idempotent transformation\\n * (e.g. a numeric increment). The provided value guarantees consistent\\n * behavior for non-idempotent transforms and allow us to return the same\\n * latency-compensated value even if the backend has already applied the\\n * mutation. The base value is null for idempotent mutations, as they can be\\n * re-played even if the backend has already applied them.\\n *\\n * @returns a base value to store along with the mutation, or null for\\n * idempotent mutations.\\n */ function vn(t, e) {\\n    let n = null;\\n    for (const s of t.fieldTransforms) {\\n        const t = e.data.field(s.field), i = ln(s.transform, t || null);\\n        null != i && (null == n && (n = te.empty()), n.set(s.field, i));\\n    }\\n    return n || null;\\n}\\n\\nfunction Sn(t, e) {\\n    return t.type === e.type && (!!t.key.isEqual(e.key) && (!!t.precondition.isEqual(e.precondition) && (!!function(t, e) {\\n        return void 0 === t && void 0 === e || !(!t || !e) && ot(t, e, ((t, e) => Tn(t, e)));\\n    }(t.fieldTransforms, e.fieldTransforms) && (0 /* Set */ === t.type ? t.value.isEqual(e.value) : 1 /* Patch */ !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)))));\\n}\\n\\n/**\\n * Returns the version from the given document for use as the result of a\\n * mutation. Mutations are defined to return the version of the base document\\n * only if it is an existing document. Deleted and unknown documents have a\\n * post-mutation version of SnapshotVersion.min().\\n */ function Dn(t) {\\n    return t.isFoundDocument() ? t.version : ct.min();\\n}\\n\\n/**\\n * A mutation that creates or replaces the document at the given key with the\\n * object value contents.\\n */ class Cn extends bn {\\n    constructor(t, e, n, s = []) {\\n        super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s, \\n        this.type = 0 /* Set */;\\n    }\\n}\\n\\nclass xn extends bn {\\n    constructor(t, e, n, s, i = []) {\\n        super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s, \\n        this.fieldTransforms = i, this.type = 1 /* Patch */;\\n    }\\n}\\n\\nfunction Nn(t) {\\n    const e = new Map;\\n    return t.fieldMask.fields.forEach((n => {\\n        if (!n.isEmpty()) {\\n            const s = t.data.field(n);\\n            e.set(n, s);\\n        }\\n    })), e;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use after a mutation\\n * containing transforms has been acknowledged by the server.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param mutableDocument - The current state of the document after applying all\\n * previous mutations.\\n * @param serverTransformResults - The transform results received by the server.\\n * @returns The transform results list.\\n */ function kn(t, e, n) {\\n    const s = new Map;\\n    U(t.length === n.length);\\n    for (let i = 0; i < n.length; i++) {\\n        const r = t[i], o = r.transform, u = e.data.field(r.field);\\n        s.set(r.field, hn(o, u, n[i]));\\n    }\\n    return s;\\n}\\n\\n/**\\n * Creates a list of \\\"transform results\\\" (a transform result is a field value\\n * representing the result of applying a transform) for use when applying a\\n * transform locally.\\n *\\n * @param fieldTransforms - The field transforms to apply the result to.\\n * @param localWriteTime - The local time of the mutation (used to\\n *     generate ServerTimestampValues).\\n * @param mutableDocument - The current state of the document after applying all\\n *     previous mutations.\\n * @returns The transform results list.\\n */ function Mn(t, e, n) {\\n    const s = new Map;\\n    for (const i of t) {\\n        const t = i.transform, r = n.data.field(i.field);\\n        s.set(i.field, cn(t, r, e));\\n    }\\n    return s;\\n}\\n\\n/** A mutation that deletes the document at the given key. */ class On extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];\\n    }\\n}\\n\\nclass Fn extends bn {\\n    constructor(t, e) {\\n        super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class $n {\\n    // TODO(b/33078163): just use simplest form of existence filter for now\\n    constructor(t) {\\n        this.count = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Error Codes describing the different ways GRPC can fail. These are copied\\n * directly from GRPC's sources here:\\n *\\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\\n *\\n * Important! The names of these identifiers matter because the string forms\\n * are used for reverse lookups from the webchannel stream. Do NOT change the\\n * names of these identifiers or change this into a const enum.\\n */ var Bn, Ln;\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a non-write operation.\\n *\\n * See isPermanentWriteError for classifying write errors.\\n */\\nfunction Un(t) {\\n    switch (t) {\\n      default:\\n        return L();\\n\\n      case G.CANCELLED:\\n      case G.UNKNOWN:\\n      case G.DEADLINE_EXCEEDED:\\n      case G.RESOURCE_EXHAUSTED:\\n      case G.INTERNAL:\\n      case G.UNAVAILABLE:\\n // Unauthenticated means something went wrong with our token and we need\\n        // to retry with new credentials which will happen automatically.\\n              case G.UNAUTHENTICATED:\\n        return !1;\\n\\n      case G.INVALID_ARGUMENT:\\n      case G.NOT_FOUND:\\n      case G.ALREADY_EXISTS:\\n      case G.PERMISSION_DENIED:\\n      case G.FAILED_PRECONDITION:\\n // Aborted might be retried in some scenarios, but that is dependant on\\n        // the context and should handled individually by the calling code.\\n        // See https://cloud.google.com/apis/design/errors.\\n              case G.ABORTED:\\n      case G.OUT_OF_RANGE:\\n      case G.UNIMPLEMENTED:\\n      case G.DATA_LOSS:\\n        return !0;\\n    }\\n}\\n\\n/**\\n * Determines whether an error code represents a permanent error when received\\n * in response to a write operation.\\n *\\n * Write operations must be handled specially because as of b/119437764, ABORTED\\n * errors on the write stream should be retried too (even though ABORTED errors\\n * are not generally retryable).\\n *\\n * Note that during the initial handshake on the write stream an ABORTED error\\n * signals that we should discard our stream token (i.e. it is permanent). This\\n * means a handshake error should be classified with isPermanentError, above.\\n */\\n/**\\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\\n * are not the same as HTTP status codes.\\n *\\n * @returns The Code equivalent to the given GRPC status code. Fails if there\\n *     is no match.\\n */\\nfunction qn(t) {\\n    if (void 0 === t) \\n    // This shouldn't normally happen, but in certain error cases (like trying\\n    // to send invalid proto messages) we may get an error with no GRPC code.\\n    return F(\\\"GRPC error has no .code\\\"), G.UNKNOWN;\\n    switch (t) {\\n      case Bn.OK:\\n        return G.OK;\\n\\n      case Bn.CANCELLED:\\n        return G.CANCELLED;\\n\\n      case Bn.UNKNOWN:\\n        return G.UNKNOWN;\\n\\n      case Bn.DEADLINE_EXCEEDED:\\n        return G.DEADLINE_EXCEEDED;\\n\\n      case Bn.RESOURCE_EXHAUSTED:\\n        return G.RESOURCE_EXHAUSTED;\\n\\n      case Bn.INTERNAL:\\n        return G.INTERNAL;\\n\\n      case Bn.UNAVAILABLE:\\n        return G.UNAVAILABLE;\\n\\n      case Bn.UNAUTHENTICATED:\\n        return G.UNAUTHENTICATED;\\n\\n      case Bn.INVALID_ARGUMENT:\\n        return G.INVALID_ARGUMENT;\\n\\n      case Bn.NOT_FOUND:\\n        return G.NOT_FOUND;\\n\\n      case Bn.ALREADY_EXISTS:\\n        return G.ALREADY_EXISTS;\\n\\n      case Bn.PERMISSION_DENIED:\\n        return G.PERMISSION_DENIED;\\n\\n      case Bn.FAILED_PRECONDITION:\\n        return G.FAILED_PRECONDITION;\\n\\n      case Bn.ABORTED:\\n        return G.ABORTED;\\n\\n      case Bn.OUT_OF_RANGE:\\n        return G.OUT_OF_RANGE;\\n\\n      case Bn.UNIMPLEMENTED:\\n        return G.UNIMPLEMENTED;\\n\\n      case Bn.DATA_LOSS:\\n        return G.DATA_LOSS;\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n/**\\n * Converts an HTTP response's error status to the equivalent error code.\\n *\\n * @param status - An HTTP error response status (\\\"FAILED_PRECONDITION\\\",\\n * \\\"UNKNOWN\\\", etc.)\\n * @returns The equivalent Code. Non-matching responses are mapped to\\n *     Code.UNKNOWN.\\n */ (Ln = Bn || (Bn = {}))[Ln.OK = 0] = \\\"OK\\\", Ln[Ln.CANCELLED = 1] = \\\"CANCELLED\\\", \\nLn[Ln.UNKNOWN = 2] = \\\"UNKNOWN\\\", Ln[Ln.INVALID_ARGUMENT = 3] = \\\"INVALID_ARGUMENT\\\", \\nLn[Ln.DEADLINE_EXCEEDED = 4] = \\\"DEADLINE_EXCEEDED\\\", Ln[Ln.NOT_FOUND = 5] = \\\"NOT_FOUND\\\", \\nLn[Ln.ALREADY_EXISTS = 6] = \\\"ALREADY_EXISTS\\\", Ln[Ln.PERMISSION_DENIED = 7] = \\\"PERMISSION_DENIED\\\", \\nLn[Ln.UNAUTHENTICATED = 16] = \\\"UNAUTHENTICATED\\\", Ln[Ln.RESOURCE_EXHAUSTED = 8] = \\\"RESOURCE_EXHAUSTED\\\", \\nLn[Ln.FAILED_PRECONDITION = 9] = \\\"FAILED_PRECONDITION\\\", Ln[Ln.ABORTED = 10] = \\\"ABORTED\\\", \\nLn[Ln.OUT_OF_RANGE = 11] = \\\"OUT_OF_RANGE\\\", Ln[Ln.UNIMPLEMENTED = 12] = \\\"UNIMPLEMENTED\\\", \\nLn[Ln.INTERNAL = 13] = \\\"INTERNAL\\\", Ln[Ln.UNAVAILABLE = 14] = \\\"UNAVAILABLE\\\", Ln[Ln.DATA_LOSS = 15] = \\\"DATA_LOSS\\\";\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A map implementation that uses objects as keys. Objects must have an\\n * associated equals function and must be immutable. Entries in the map are\\n * stored together with the key being produced from the mapKeyFn. This map\\n * automatically handles collisions of keys.\\n */\\nclass Kn {\\n    constructor(t, e) {\\n        this.mapKeyFn = t, this.equalsFn = e, \\n        /**\\n         * The inner map for a key/value pair. Due to the possibility of collisions we\\n         * keep a list of entries that we do a linear search through to find an actual\\n         * match. Note that collisions should be rare, so we still expect near\\n         * constant time lookups in practice.\\n         */\\n        this.inner = {}, \\n        /** The number of entries stored in the map */\\n        this.innerSize = 0;\\n    }\\n    /** Get a value for this key, or undefined if it does not exist. */    get(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 !== n) for (const [e, s] of n) if (this.equalsFn(e, t)) return s;\\n    }\\n    has(t) {\\n        return void 0 !== this.get(t);\\n    }\\n    /** Put this key and value in the map. */    set(t, e) {\\n        const n = this.mapKeyFn(t), s = this.inner[n];\\n        if (void 0 === s) return this.inner[n] = [ [ t, e ] ], void this.innerSize++;\\n        for (let n = 0; n < s.length; n++) if (this.equalsFn(s[n][0], t)) \\n        // This is updating an existing entry and does not increase `innerSize`.\\n        return void (s[n] = [ t, e ]);\\n        s.push([ t, e ]), this.innerSize++;\\n    }\\n    /**\\n     * Remove this key from the map. Returns a boolean if anything was deleted.\\n     */    delete(t) {\\n        const e = this.mapKeyFn(t), n = this.inner[e];\\n        if (void 0 === n) return !1;\\n        for (let s = 0; s < n.length; s++) if (this.equalsFn(n[s][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(s, 1), \\n        this.innerSize--, !0;\\n        return !1;\\n    }\\n    forEach(t) {\\n        lt(this.inner, ((e, n) => {\\n            for (const [e, s] of n) t(e, s);\\n        }));\\n    }\\n    isEmpty() {\\n        return ft(this.inner);\\n    }\\n    size() {\\n        return this.innerSize;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Gn = new fe(xt.comparator);\\n\\nfunction Qn() {\\n    return Gn;\\n}\\n\\nconst jn = new fe(xt.comparator);\\n\\nfunction Wn(...t) {\\n    let e = jn;\\n    for (const n of t) e = e.insert(n.key, n);\\n    return e;\\n}\\n\\nfunction zn() {\\n    return new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n}\\n\\nconst Hn = new fe(xt.comparator);\\n\\nconst Jn = new we(xt.comparator);\\n\\nfunction Yn(...t) {\\n    let e = Jn;\\n    for (const n of t) e = e.add(n);\\n    return e;\\n}\\n\\nconst Xn = new we(rt);\\n\\nfunction Zn() {\\n    return Xn;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An event from the RemoteStore. It is split into targetChanges (changes to the\\n * state or the set of documents in our watched targets) and documentUpdates\\n * (changes to the actual documents).\\n */ class ts {\\n    constructor(\\n    /**\\n     * The snapshot version this event brings us up to, or MIN if not set.\\n     */\\n    t, \\n    /**\\n     * A map from target to changes to the target. See TargetChange.\\n     */\\n    e, \\n    /**\\n     * A set of targets that is known to be inconsistent. Listens for these\\n     * targets should be re-established without resume tokens.\\n     */\\n    n, \\n    /**\\n     * A set of which documents have changed or been deleted, along with the\\n     * doc's new values (if not deleted).\\n     */\\n    s, \\n    /**\\n     * A set of which document updates are due only to limbo resolution targets.\\n     */\\n    i) {\\n        this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = s, \\n        this.resolvedLimboDocuments = i;\\n    }\\n    /**\\n     * HACK: Views require RemoteEvents in order to determine whether the view is\\n     * CURRENT, but secondary tabs don't receive remote events. So this method is\\n     * used to create a synthesized RemoteEvent that can be used to apply a\\n     * CURRENT status change to a View, for queries executed in a different tab.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    static createSynthesizedRemoteEventForCurrentChange(t, e) {\\n        const n = new Map;\\n        return n.set(t, es.createSynthesizedTargetChangeForCurrentChange(t, e)), new ts(ct.min(), n, Zn(), Qn(), Yn());\\n    }\\n}\\n\\n/**\\n * A TargetChange specifies the set of changes for a specific target as part of\\n * a RemoteEvent. These changes track which documents are added, modified or\\n * removed, as well as the target's resume token and whether the target is\\n * marked CURRENT.\\n * The actual changes *to* documents are not part of the TargetChange since\\n * documents may be part of multiple targets.\\n */ class es {\\n    constructor(\\n    /**\\n     * An opaque, server-assigned token that allows watching a query to be resumed\\n     * after disconnecting without retransmitting all the data that matches the\\n     * query. The resume token essentially identifies a point in time from which\\n     * the server should resume sending results.\\n     */\\n    t, \\n    /**\\n     * The \\\"current\\\" (synced) status of this target. Note that \\\"current\\\"\\n     * has special meaning in the RPC protocol that implies that a target is\\n     * both up-to-date and consistent with the rest of the watch stream.\\n     */\\n    e, \\n    /**\\n     * The set of documents that were newly assigned to this target as part of\\n     * this remote event.\\n     */\\n    n, \\n    /**\\n     * The set of documents that were already assigned to this target but received\\n     * an update during this remote event.\\n     */\\n    s, \\n    /**\\n     * The set of documents that were removed from this target as part of this\\n     * remote event.\\n     */\\n    i) {\\n        this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = s, \\n        this.removedDocuments = i;\\n    }\\n    /**\\n     * This method is used to create a synthesized TargetChanges that can be used to\\n     * apply a CURRENT status change to a View (for queries executed in a different\\n     * tab) or for new queries (to raise snapshots with correct CURRENT status).\\n     */    static createSynthesizedTargetChangeForCurrentChange(t, e) {\\n        return new es(pt.EMPTY_BYTE_STRING, e, Yn(), Yn(), Yn());\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents a changed document and a list of target ids to which this change\\n * applies.\\n *\\n * If document has been deleted NoDocument will be provided.\\n */ class ns {\\n    constructor(\\n    /** The new document applies to all of these targets. */\\n    t, \\n    /** The new document is removed from all of these targets. */\\n    e, \\n    /** The key of the document for this change. */\\n    n, \\n    /**\\n     * The new document or NoDocument if it was deleted. Is null if the\\n     * document went out of view without the server sending a new document.\\n     */\\n    s) {\\n        this.O = t, this.removedTargetIds = e, this.key = n, this.F = s;\\n    }\\n}\\n\\nclass ss {\\n    constructor(t, e) {\\n        this.targetId = t, this.$ = e;\\n    }\\n}\\n\\nclass is {\\n    constructor(\\n    /** What kind of change occurred to the watch target. */\\n    t, \\n    /** The target IDs that were added/removed/set. */\\n    e, \\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */\\n    n = pt.EMPTY_BYTE_STRING\\n    /** An RPC error indicating why the watch failed. */ , s = null) {\\n        this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;\\n    }\\n}\\n\\n/** Tracks the internal state of a Watch target. */ class rs {\\n    constructor() {\\n        /**\\n         * The number of pending responses (adds or removes) that we are waiting on.\\n         * We only consider targets active that have no pending responses.\\n         */\\n        this.B = 0, \\n        /**\\n         * Keeps track of the document changes since the last raised snapshot.\\n         *\\n         * These changes are continuously updated as we receive document updates and\\n         * always reflect the current set of changes against the last issued snapshot.\\n         */\\n        this.L = as(), \\n        /** See public getters for explanations of these fields. */\\n        this.U = pt.EMPTY_BYTE_STRING, this.q = !1, \\n        /**\\n         * Whether this target state should be included in the next snapshot. We\\n         * initialize to true so that newly-added targets are included in the next\\n         * RemoteEvent.\\n         */\\n        this.K = !0;\\n    }\\n    /**\\n     * Whether this target has been marked 'current'.\\n     *\\n     * 'Current' has special meaning in the RPC protocol: It implies that the\\n     * Watch backend has sent us all changes up to the point at which the target\\n     * was added and that the target is consistent with the rest of the watch\\n     * stream.\\n     */    get current() {\\n        return this.q;\\n    }\\n    /** The last resume token sent to us for this target. */    get resumeToken() {\\n        return this.U;\\n    }\\n    /** Whether this target has pending target adds or target removes. */    get G() {\\n        return 0 !== this.B;\\n    }\\n    /** Whether we have modified any state that should trigger a snapshot. */    get j() {\\n        return this.K;\\n    }\\n    /**\\n     * Applies the resume token to the TargetChange, but only when it has a new\\n     * value. Empty resumeTokens are discarded.\\n     */    W(t) {\\n        t.approximateByteSize() > 0 && (this.K = !0, this.U = t);\\n    }\\n    /**\\n     * Creates a target change from the current set of changes.\\n     *\\n     * To reset the document changes after raising this snapshot, call\\n     * `clearPendingChanges()`.\\n     */    H() {\\n        let t = Yn(), e = Yn(), n = Yn();\\n        return this.L.forEach(((s, i) => {\\n            switch (i) {\\n              case 0 /* Added */ :\\n                t = t.add(s);\\n                break;\\n\\n              case 2 /* Modified */ :\\n                e = e.add(s);\\n                break;\\n\\n              case 1 /* Removed */ :\\n                n = n.add(s);\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        })), new es(this.U, this.q, t, e, n);\\n    }\\n    /**\\n     * Resets the document changes and sets `hasPendingChanges` to false.\\n     */    J() {\\n        this.K = !1, this.L = as();\\n    }\\n    Y(t, e) {\\n        this.K = !0, this.L = this.L.insert(t, e);\\n    }\\n    X(t) {\\n        this.K = !0, this.L = this.L.remove(t);\\n    }\\n    Z() {\\n        this.B += 1;\\n    }\\n    tt() {\\n        this.B -= 1;\\n    }\\n    et() {\\n        this.K = !0, this.q = !0;\\n    }\\n}\\n\\n/**\\n * A helper class to accumulate watch changes into a RemoteEvent.\\n */\\nclass os {\\n    constructor(t) {\\n        this.nt = t, \\n        /** The internal state of all tracked targets. */\\n        this.st = new Map, \\n        /** Keeps track of the documents to update since the last raised snapshot. */\\n        this.it = Qn(), \\n        /** A mapping of document keys to their set of target IDs. */\\n        this.rt = us(), \\n        /**\\n         * A list of targets with existence filter mismatches. These targets are\\n         * known to be inconsistent and their listens needs to be re-established by\\n         * RemoteStore.\\n         */\\n        this.ot = new we(rt);\\n    }\\n    /**\\n     * Processes and adds the DocumentWatchChange to the current set of changes.\\n     */    ut(t) {\\n        for (const e of t.O) t.F && t.F.isFoundDocument() ? this.at(e, t.F) : this.ct(e, t.key, t.F);\\n        for (const e of t.removedTargetIds) this.ct(e, t.key, t.F);\\n    }\\n    /** Processes and adds the WatchTargetChange to the current set of changes. */    ht(t) {\\n        this.forEachTarget(t, (e => {\\n            const n = this.lt(e);\\n            switch (t.state) {\\n              case 0 /* NoChange */ :\\n                this.ft(e) && n.W(t.resumeToken);\\n                break;\\n\\n              case 1 /* Added */ :\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || \\n                // We have a freshly added target, so we need to reset any state\\n                // that we had previously. This can happen e.g. when remove and add\\n                // back a target for existence filter mismatches.\\n                n.J(), n.W(t.resumeToken);\\n                break;\\n\\n              case 2 /* Removed */ :\\n                // We need to keep track of removed targets to we can post-filter and\\n                // remove any target changes.\\n                // We need to decrement the number of pending acks needed from watch\\n                // for this targetId.\\n                n.tt(), n.G || this.removeTarget(e);\\n                break;\\n\\n              case 3 /* Current */ :\\n                this.ft(e) && (n.et(), n.W(t.resumeToken));\\n                break;\\n\\n              case 4 /* Reset */ :\\n                this.ft(e) && (\\n                // Reset the target and synthesizes removes for all existing\\n                // documents. The backend will re-add any documents that still\\n                // match the target before it sends the next global snapshot.\\n                this.dt(e), n.W(t.resumeToken));\\n                break;\\n\\n              default:\\n                L();\\n            }\\n        }));\\n    }\\n    /**\\n     * Iterates over all targetIds that the watch change applies to: either the\\n     * targetIds explicitly listed in the change or the targetIds of all currently\\n     * active targets.\\n     */    forEachTarget(t, e) {\\n        t.targetIds.length > 0 ? t.targetIds.forEach(e) : this.st.forEach(((t, n) => {\\n            this.ft(n) && e(n);\\n        }));\\n    }\\n    /**\\n     * Handles existence filters and synthesizes deletes for filter mismatches.\\n     * Targets that are invalidated by filter mismatches are added to\\n     * `pendingTargetResets`.\\n     */    _t(t) {\\n        const e = t.targetId, n = t.$.count, s = this.wt(e);\\n        if (s) {\\n            const t = s.target;\\n            if (Ae(t)) if (0 === n) {\\n                // The existence filter told us the document does not exist. We deduce\\n                // that this document does not exist and apply a deleted document to\\n                // our updates. Without applying this deleted document there might be\\n                // another query that will raise this document as part of a snapshot\\n                // until it is resolved, essentially exposing inconsistency between\\n                // queries.\\n                const n = new xt(t.path);\\n                this.ct(e, n, ne.newNoDocument(n, ct.min()));\\n            } else U(1 === n); else {\\n                this.gt(e) !== n && (\\n                // Existence filter mismatch: We reset the mapping and raise a new\\n                // snapshot with `isFromCache:true`.\\n                this.dt(e), this.ot = this.ot.add(e));\\n            }\\n        }\\n    }\\n    /**\\n     * Converts the currently accumulated state into a remote event at the\\n     * provided snapshot version. Resets the accumulated changes before returning.\\n     */    yt(t) {\\n        const e = new Map;\\n        this.st.forEach(((n, s) => {\\n            const i = this.wt(s);\\n            if (i) {\\n                if (n.current && Ae(i.target)) {\\n                    // Document queries for document that don't exist can produce an empty\\n                    // result set. To update our local cache, we synthesize a document\\n                    // delete if we have not previously received the document. This\\n                    // resolves the limbo state of the document, removing it from\\n                    // limboDocumentRefs.\\n                    // TODO(dimond): Ideally we would have an explicit lookup target\\n                    // instead resulting in an explicit delete message and we could\\n                    // remove this special logic.\\n                    const e = new xt(i.target.path);\\n                    null !== this.it.get(e) || this.It(s, e) || this.ct(s, e, ne.newNoDocument(e, t));\\n                }\\n                n.j && (e.set(s, n.H()), n.J());\\n            }\\n        }));\\n        let n = Yn();\\n        // We extract the set of limbo-only document updates as the GC logic\\n        // special-cases documents that do not appear in the target cache.\\n        \\n        // TODO(gsoltis): Expand on this comment once GC is available in the JS\\n        // client.\\n                this.rt.forEach(((t, e) => {\\n            let s = !0;\\n            e.forEachWhile((t => {\\n                const e = this.wt(t);\\n                return !e || 2 /* LimboResolution */ === e.purpose || (s = !1, !1);\\n            })), s && (n = n.add(t));\\n        })), this.it.forEach(((e, n) => n.setReadTime(t)));\\n        const s = new ts(t, e, this.ot, this.it, n);\\n        return this.it = Qn(), this.rt = us(), this.ot = new we(rt), s;\\n    }\\n    /**\\n     * Adds the provided document to the internal list of document updates and\\n     * its document key to the given target's mapping.\\n     */\\n    // Visible for testing.\\n    at(t, e) {\\n        if (!this.ft(t)) return;\\n        const n = this.It(t, e.key) ? 2 /* Modified */ : 0 /* Added */;\\n        this.lt(t).Y(e.key, n), this.it = this.it.insert(e.key, e), this.rt = this.rt.insert(e.key, this.Tt(e.key).add(t));\\n    }\\n    /**\\n     * Removes the provided document from the target mapping. If the\\n     * document no longer matches the target, but the document's state is still\\n     * known (e.g. we know that the document was deleted or we received the change\\n     * that caused the filter mismatch), the new document can be provided\\n     * to update the remote document cache.\\n     */\\n    // Visible for testing.\\n    ct(t, e, n) {\\n        if (!this.ft(t)) return;\\n        const s = this.lt(t);\\n        this.It(t, e) ? s.Y(e, 1 /* Removed */) : \\n        // The document may have entered and left the target before we raised a\\n        // snapshot, so we can just ignore the change.\\n        s.X(e), this.rt = this.rt.insert(e, this.Tt(e).delete(t)), n && (this.it = this.it.insert(e, n));\\n    }\\n    removeTarget(t) {\\n        this.st.delete(t);\\n    }\\n    /**\\n     * Returns the current count of documents in the target. This includes both\\n     * the number of documents that the LocalStore considers to be part of the\\n     * target as well as any accumulated changes.\\n     */    gt(t) {\\n        const e = this.lt(t).H();\\n        return this.nt.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size;\\n    }\\n    /**\\n     * Increment the number of acks needed from watch before we can consider the\\n     * server to be 'in-sync' with the client's active targets.\\n     */    Z(t) {\\n        this.lt(t).Z();\\n    }\\n    lt(t) {\\n        let e = this.st.get(t);\\n        return e || (e = new rs, this.st.set(t, e)), e;\\n    }\\n    Tt(t) {\\n        let e = this.rt.get(t);\\n        return e || (e = new we(rt), this.rt = this.rt.insert(t, e)), e;\\n    }\\n    /**\\n     * Verifies that the user is still interested in this target (by calling\\n     * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\\n     * from watch.\\n     */    ft(t) {\\n        const e = null !== this.wt(t);\\n        return e || O(\\\"WatchChangeAggregator\\\", \\\"Detected inactive target\\\", t), e;\\n    }\\n    /**\\n     * Returns the TargetData for an active target (i.e. a target that the user\\n     * is still interested in that has no outstanding target change requests).\\n     */    wt(t) {\\n        const e = this.st.get(t);\\n        return e && e.G ? null : this.nt.Et(t);\\n    }\\n    /**\\n     * Resets the state of a Watch target to its initial state (e.g. sets\\n     * 'current' to false, clears the resume token and removes its target mapping\\n     * from all documents).\\n     */    dt(t) {\\n        this.st.set(t, new rs);\\n        this.nt.getRemoteKeysForTarget(t).forEach((e => {\\n            this.ct(t, e, /*updatedDocument=*/ null);\\n        }));\\n    }\\n    /**\\n     * Returns whether the LocalStore considers the document to be part of the\\n     * specified target.\\n     */    It(t, e) {\\n        return this.nt.getRemoteKeysForTarget(t).has(e);\\n    }\\n}\\n\\nfunction us() {\\n    return new fe(xt.comparator);\\n}\\n\\nfunction as() {\\n    return new fe(xt.comparator);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const cs = (() => {\\n    const t = {\\n        asc: \\\"ASCENDING\\\",\\n        desc: \\\"DESCENDING\\\"\\n    };\\n    return t;\\n})(), hs = (() => {\\n    const t = {\\n        \\\"<\\\": \\\"LESS_THAN\\\",\\n        \\\"<=\\\": \\\"LESS_THAN_OR_EQUAL\\\",\\n        \\\">\\\": \\\"GREATER_THAN\\\",\\n        \\\">=\\\": \\\"GREATER_THAN_OR_EQUAL\\\",\\n        \\\"==\\\": \\\"EQUAL\\\",\\n        \\\"!=\\\": \\\"NOT_EQUAL\\\",\\n        \\\"array-contains\\\": \\\"ARRAY_CONTAINS\\\",\\n        in: \\\"IN\\\",\\n        \\\"not-in\\\": \\\"NOT_IN\\\",\\n        \\\"array-contains-any\\\": \\\"ARRAY_CONTAINS_ANY\\\"\\n    };\\n    return t;\\n})();\\n\\n/**\\n * This class generates JsonObject values for the Datastore API suitable for\\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\\n *\\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\\n * format.\\n *\\n * For a description of the Proto3 JSON format check\\n * https://developers.google.com/protocol-buffers/docs/proto3#json\\n *\\n * TODO(klimt): We can remove the databaseId argument if we keep the full\\n * resource name in documents.\\n */\\nclass ls {\\n    constructor(t, e) {\\n        this.databaseId = t, this.N = e;\\n    }\\n}\\n\\n/**\\n * Returns a value for a Date that's appropriate to put into a proto.\\n */\\nfunction fs(t, e) {\\n    if (t.N) {\\n        return `${new Date(1e3 * e.seconds).toISOString().replace(/\\\\.\\\\d*/, \\\"\\\").replace(\\\"Z\\\", \\\"\\\")}.${(\\\"000000000\\\" + e.nanoseconds).slice(-9)}Z`;\\n    }\\n    return {\\n        seconds: \\\"\\\" + e.seconds,\\n        nanos: e.nanoseconds\\n    };\\n}\\n\\n/**\\n * Returns a value for bytes that's appropriate to put in a proto.\\n *\\n * Visible for testing.\\n */\\nfunction ds(t, e) {\\n    return t.N ? e.toBase64() : e.toUint8Array();\\n}\\n\\n/**\\n * Returns a ByteString based on the proto string value.\\n */ function _s(t, e) {\\n    return fs(t, e.toTimestamp());\\n}\\n\\nfunction ws(t) {\\n    return U(!!t), ct.fromTimestamp(function(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }(t));\\n}\\n\\nfunction ms(t, e) {\\n    return function(t) {\\n        return new _t([ \\\"projects\\\", t.projectId, \\\"databases\\\", t.database ]);\\n    }(t).child(\\\"documents\\\").child(e).canonicalString();\\n}\\n\\nfunction gs(t) {\\n    const e = _t.fromString(t);\\n    return U(Ks(e)), e;\\n}\\n\\nfunction ys(t, e) {\\n    return ms(t.databaseId, e.path);\\n}\\n\\nfunction ps(t, e) {\\n    const n = gs(e);\\n    if (n.get(1) !== t.databaseId.projectId) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different project: \\\" + n.get(1) + \\\" vs \\\" + t.databaseId.projectId);\\n    if (n.get(3) !== t.databaseId.database) throw new Q(G.INVALID_ARGUMENT, \\\"Tried to deserialize key from different database: \\\" + n.get(3) + \\\" vs \\\" + t.databaseId.database);\\n    return new xt(As(n));\\n}\\n\\nfunction Is(t, e) {\\n    return ms(t.databaseId, e);\\n}\\n\\nfunction Ts(t) {\\n    const e = gs(t);\\n    // In v1beta1 queries for collections at the root did not have a trailing\\n    // \\\"/documents\\\". In v1 all resource paths contain \\\"/documents\\\". Preserve the\\n    // ability to read the v1beta1 form for compatibility with queries persisted\\n    // in the local target cache.\\n        return 4 === e.length ? _t.emptyPath() : As(e);\\n}\\n\\nfunction Es(t) {\\n    return new _t([ \\\"projects\\\", t.databaseId.projectId, \\\"databases\\\", t.databaseId.database ]).canonicalString();\\n}\\n\\nfunction As(t) {\\n    return U(t.length > 4 && \\\"documents\\\" === t.get(4)), t.popFirst(5);\\n}\\n\\n/** Creates a Document proto from key and fields (but no create/update time) */ function Rs(t, e, n) {\\n    return {\\n        name: ys(t, e),\\n        fields: n.value.mapValue.fields\\n    };\\n}\\n\\nfunction bs(t, e, n) {\\n    const s = ps(t, e.name), i = ws(e.updateTime), r = new te({\\n        mapValue: {\\n            fields: e.fields\\n        }\\n    }), o = ne.newFoundDocument(s, i, r);\\n    return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;\\n}\\n\\nfunction Ps(t, e) {\\n    return \\\"found\\\" in e ? function(t, e) {\\n        U(!!e.found), e.found.name, e.found.updateTime;\\n        const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({\\n            mapValue: {\\n                fields: e.found.fields\\n            }\\n        });\\n        return ne.newFoundDocument(n, s, i);\\n    }(t, e) : \\\"missing\\\" in e ? function(t, e) {\\n        U(!!e.missing), U(!!e.readTime);\\n        const n = ps(t, e.missing), s = ws(e.readTime);\\n        return ne.newNoDocument(n, s);\\n    }(t, e) : L();\\n}\\n\\nfunction Vs(t, e) {\\n    let n;\\n    if (\\\"targetChange\\\" in e) {\\n        e.targetChange;\\n        // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\\n        // if unset\\n        const s = function(t) {\\n            return \\\"NO_CHANGE\\\" === t ? 0 /* NoChange */ : \\\"ADD\\\" === t ? 1 /* Added */ : \\\"REMOVE\\\" === t ? 2 /* Removed */ : \\\"CURRENT\\\" === t ? 3 /* Current */ : \\\"RESET\\\" === t ? 4 /* Reset */ : L();\\n        }(e.targetChange.targetChangeType || \\\"NO_CHANGE\\\"), i = e.targetChange.targetIds || [], r = function(t, e) {\\n            return t.N ? (U(void 0 === e || \\\"string\\\" == typeof e), pt.fromBase64String(e || \\\"\\\")) : (U(void 0 === e || e instanceof Uint8Array), \\n            pt.fromUint8Array(e || new Uint8Array));\\n        }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {\\n            const e = void 0 === t.code ? G.UNKNOWN : qn(t.code);\\n            return new Q(e, t.message || \\\"\\\");\\n        }\\n        /**\\n * Returns a value for a number (or null) that's appropriate to put into\\n * a google.protobuf.Int32Value proto.\\n * DO NOT USE THIS FOR ANYTHING ELSE.\\n * This method cheats. It's typed as returning \\\"number\\\" because that's what\\n * our generated proto interfaces say Int32Value must be. But GRPC actually\\n * expects a { value: <number> } struct.\\n */ (o);\\n        n = new is(s, i, r, u || null);\\n    } else if (\\\"documentChange\\\" in e) {\\n        e.documentChange;\\n        const s = e.documentChange;\\n        s.document, s.document.name, s.document.updateTime;\\n        const i = ps(t, s.document.name), r = ws(s.document.updateTime), o = new te({\\n            mapValue: {\\n                fields: s.document.fields\\n            }\\n        }), u = ne.newFoundDocument(i, r, o), a = s.targetIds || [], c = s.removedTargetIds || [];\\n        n = new ns(a, c, u.key, u);\\n    } else if (\\\"documentDelete\\\" in e) {\\n        e.documentDelete;\\n        const s = e.documentDelete;\\n        s.document;\\n        const i = ps(t, s.document), r = s.readTime ? ws(s.readTime) : ct.min(), o = ne.newNoDocument(i, r), u = s.removedTargetIds || [];\\n        n = new ns([], u, o.key, o);\\n    } else if (\\\"documentRemove\\\" in e) {\\n        e.documentRemove;\\n        const s = e.documentRemove;\\n        s.document;\\n        const i = ps(t, s.document), r = s.removedTargetIds || [];\\n        n = new ns([], r, i, null);\\n    } else {\\n        if (!(\\\"filter\\\" in e)) return L();\\n        {\\n            e.filter;\\n            const t = e.filter;\\n            t.targetId;\\n            const s = t.count || 0, i = new $n(s), r = t.targetId;\\n            n = new ss(r, i);\\n        }\\n    }\\n    return n;\\n}\\n\\nfunction vs(t, e) {\\n    let n;\\n    if (e instanceof Cn) n = {\\n        update: Rs(t, e.key, e.value)\\n    }; else if (e instanceof On) n = {\\n        delete: ys(t, e.key)\\n    }; else if (e instanceof xn) n = {\\n        update: Rs(t, e.key, e.data),\\n        updateMask: qs(e.fieldMask)\\n    }; else {\\n        if (!(e instanceof Fn)) return L();\\n        n = {\\n            verify: ys(t, e.key)\\n        };\\n    }\\n    return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {\\n        const n = e.transform;\\n        if (n instanceof fn) return {\\n            fieldPath: e.field.canonicalString(),\\n            setToServerValue: \\\"REQUEST_TIME\\\"\\n        };\\n        if (n instanceof dn) return {\\n            fieldPath: e.field.canonicalString(),\\n            appendMissingElements: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof wn) return {\\n            fieldPath: e.field.canonicalString(),\\n            removeAllFromArray: {\\n                values: n.elements\\n            }\\n        };\\n        if (n instanceof gn) return {\\n            fieldPath: e.field.canonicalString(),\\n            increment: n.k\\n        };\\n        throw L();\\n    }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {\\n        return void 0 !== e.updateTime ? {\\n            updateTime: _s(t, e.updateTime)\\n        } : void 0 !== e.exists ? {\\n            exists: e.exists\\n        } : L();\\n    }(t, e.precondition)), n;\\n}\\n\\nfunction Ss(t, e) {\\n    const n = e.currentDocument ? function(t) {\\n        return void 0 !== t.updateTime ? An.updateTime(ws(t.updateTime)) : void 0 !== t.exists ? An.exists(t.exists) : An.none();\\n    }(e.currentDocument) : An.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {\\n        let n = null;\\n        if (\\\"setToServerValue\\\" in e) U(\\\"REQUEST_TIME\\\" === e.setToServerValue), n = new fn; else if (\\\"appendMissingElements\\\" in e) {\\n            const t = e.appendMissingElements.values || [];\\n            n = new dn(t);\\n        } else if (\\\"removeAllFromArray\\\" in e) {\\n            const t = e.removeAllFromArray.values || [];\\n            n = new wn(t);\\n        } else \\\"increment\\\" in e ? n = new gn(t, e.increment) : L();\\n        const s = mt.fromServerFormat(e.fieldPath);\\n        return new In(s, n);\\n    }(t, e))) : [];\\n    if (e.update) {\\n        e.update.name;\\n        const i = ps(t, e.update.name), r = new te({\\n            mapValue: {\\n                fields: e.update.fields\\n            }\\n        });\\n        if (e.updateMask) {\\n            const t = function(t) {\\n                const e = t.fieldPaths || [];\\n                return new gt(e.map((t => mt.fromServerFormat(t))));\\n            }(e.updateMask);\\n            return new xn(i, r, t, n, s);\\n        }\\n        return new Cn(i, r, n, s);\\n    }\\n    if (e.delete) {\\n        const s = ps(t, e.delete);\\n        return new On(s, n);\\n    }\\n    if (e.verify) {\\n        const s = ps(t, e.verify);\\n        return new Fn(s, n);\\n    }\\n    return L();\\n}\\n\\nfunction Ds(t, e) {\\n    return t && t.length > 0 ? (U(void 0 !== e), t.map((t => function(t, e) {\\n        // NOTE: Deletes don't have an updateTime.\\n        let n = t.updateTime ? ws(t.updateTime) : ws(e);\\n        return n.isEqual(ct.min()) && (\\n        // The Firestore Emulator currently returns an update time of 0 for\\n        // deletes of non-existing documents (rather than null). This breaks the\\n        // test \\\"get deleted doc while offline with source=cache\\\" as NoDocuments\\n        // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\\n        // TODO(#2149): Remove this when Emulator is fixed\\n        n = ws(e)), new En(n, t.transformResults || []);\\n    }(t, e)))) : [];\\n}\\n\\nfunction Cs(t, e) {\\n    return {\\n        documents: [ Is(t, e.path) ]\\n    };\\n}\\n\\nfunction xs(t, e) {\\n    // Dissect the path into parent, collectionId, and optional key filter.\\n    const n = {\\n        structuredQuery: {}\\n    }, s = e.path;\\n    null !== e.collectionGroup ? (n.parent = Is(t, s), n.structuredQuery.from = [ {\\n        collectionId: e.collectionGroup,\\n        allDescendants: !0\\n    } ]) : (n.parent = Is(t, s.popLast()), n.structuredQuery.from = [ {\\n        collectionId: s.lastSegment()\\n    } ]);\\n    const i = function(t) {\\n        if (0 === t.length) return;\\n        const e = t.map((t => \\n        // visible for testing\\n        function(t) {\\n            if (\\\"==\\\" /* EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NULL\\\"\\n                    }\\n                };\\n            } else if (\\\"!=\\\" /* NOT_EQUAL */ === t.op) {\\n                if (jt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NAN\\\"\\n                    }\\n                };\\n                if (Qt(t.value)) return {\\n                    unaryFilter: {\\n                        field: $s(t.field),\\n                        op: \\\"IS_NOT_NULL\\\"\\n                    }\\n                };\\n            }\\n            return {\\n                fieldFilter: {\\n                    field: $s(t.field),\\n                    op: Fs(t.op),\\n                    value: t.value\\n                }\\n            };\\n        }(t)));\\n        if (1 === e.length) return e[0];\\n        return {\\n            compositeFilter: {\\n                op: \\\"AND\\\",\\n                filters: e\\n            }\\n        };\\n    }(e.filters);\\n    i && (n.structuredQuery.where = i);\\n    const r = function(t) {\\n        if (0 === t.length) return;\\n        return t.map((t => \\n        // visible for testing\\n        function(t) {\\n            return {\\n                field: $s(t.field),\\n                direction: Os(t.dir)\\n            };\\n        }(t)));\\n    }(e.orderBy);\\n    r && (n.structuredQuery.orderBy = r);\\n    const o = function(t, e) {\\n        return t.N || St(e) ? e : {\\n            value: e\\n        };\\n    }\\n    /**\\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\\n */ (t, e.limit);\\n    var u;\\n    return null !== o && (n.structuredQuery.limit = o), e.startAt && (n.structuredQuery.startAt = {\\n        before: (u = e.startAt).inclusive,\\n        values: u.position\\n    }), e.endAt && (n.structuredQuery.endAt = function(t) {\\n        return {\\n            before: !t.inclusive,\\n            values: t.position\\n        };\\n    }(e.endAt)), n;\\n}\\n\\nfunction Ns(t) {\\n    let e = Ts(t.parent);\\n    const n = t.structuredQuery, s = n.from ? n.from.length : 0;\\n    let i = null;\\n    if (s > 0) {\\n        U(1 === s);\\n        const t = n.from[0];\\n        t.allDescendants ? i = t.collectionId : e = e.child(t.collectionId);\\n    }\\n    let r = [];\\n    n.where && (r = Ms(n.where));\\n    let o = [];\\n    n.orderBy && (o = n.orderBy.map((t => function(t) {\\n        return new Fe(Bs(t.field), \\n        // visible for testing\\n        function(t) {\\n            switch (t) {\\n              case \\\"ASCENDING\\\":\\n                return \\\"asc\\\" /* ASCENDING */;\\n\\n              case \\\"DESCENDING\\\":\\n                return \\\"desc\\\" /* DESCENDING */;\\n\\n              default:\\n                return;\\n            }\\n        }\\n        // visible for testing\\n        (t.direction));\\n    }(t))));\\n    let u = null;\\n    n.limit && (u = function(t) {\\n        let e;\\n        return e = \\\"object\\\" == typeof t ? t.value : t, St(e) ? null : e;\\n    }(n.limit));\\n    let a = null;\\n    n.startAt && (a = function(t) {\\n        const e = !!t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }(n.startAt));\\n    let c = null;\\n    return n.endAt && (c = function(t) {\\n        const e = !t.before, n = t.values || [];\\n        return new Oe(n, e);\\n    }\\n    // visible for testing\\n    (n.endAt)), qe(e, i, o, r, u, \\\"F\\\" /* First */ , a, c);\\n}\\n\\nfunction ks(t, e) {\\n    const n = function(t, e) {\\n        switch (e) {\\n          case 0 /* Listen */ :\\n            return null;\\n\\n          case 1 /* ExistenceFilterMismatch */ :\\n            return \\\"existence-filter-mismatch\\\";\\n\\n          case 2 /* LimboResolution */ :\\n            return \\\"limbo-document\\\";\\n\\n          default:\\n            return L();\\n        }\\n    }(0, e.purpose);\\n    return null == n ? null : {\\n        \\\"goog-listen-tags\\\": n\\n    };\\n}\\n\\nfunction Ms(t) {\\n    return t ? void 0 !== t.unaryFilter ? [ Us(t) ] : void 0 !== t.fieldFilter ? [ Ls(t) ] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map((t => Ms(t))).reduce(((t, e) => t.concat(e))) : L() : [];\\n}\\n\\nfunction Os(t) {\\n    return cs[t];\\n}\\n\\nfunction Fs(t) {\\n    return hs[t];\\n}\\n\\nfunction $s(t) {\\n    return {\\n        fieldPath: t.canonicalString()\\n    };\\n}\\n\\nfunction Bs(t) {\\n    return mt.fromServerFormat(t.fieldPath);\\n}\\n\\nfunction Ls(t) {\\n    return Ve.create(Bs(t.fieldFilter.field), function(t) {\\n        switch (t) {\\n          case \\\"EQUAL\\\":\\n            return \\\"==\\\" /* EQUAL */;\\n\\n          case \\\"NOT_EQUAL\\\":\\n            return \\\"!=\\\" /* NOT_EQUAL */;\\n\\n          case \\\"GREATER_THAN\\\":\\n            return \\\">\\\" /* GREATER_THAN */;\\n\\n          case \\\"GREATER_THAN_OR_EQUAL\\\":\\n            return \\\">=\\\" /* GREATER_THAN_OR_EQUAL */;\\n\\n          case \\\"LESS_THAN\\\":\\n            return \\\"<\\\" /* LESS_THAN */;\\n\\n          case \\\"LESS_THAN_OR_EQUAL\\\":\\n            return \\\"<=\\\" /* LESS_THAN_OR_EQUAL */;\\n\\n          case \\\"ARRAY_CONTAINS\\\":\\n            return \\\"array-contains\\\" /* ARRAY_CONTAINS */;\\n\\n          case \\\"IN\\\":\\n            return \\\"in\\\" /* IN */;\\n\\n          case \\\"NOT_IN\\\":\\n            return \\\"not-in\\\" /* NOT_IN */;\\n\\n          case \\\"ARRAY_CONTAINS_ANY\\\":\\n            return \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */;\\n\\n          default:\\n            return L();\\n        }\\n    }(t.fieldFilter.op), t.fieldFilter.value);\\n}\\n\\nfunction Us(t) {\\n    switch (t.unaryFilter.op) {\\n      case \\\"IS_NAN\\\":\\n        const e = Bs(t.unaryFilter.field);\\n        return Ve.create(e, \\\"==\\\" /* EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NULL\\\":\\n        const n = Bs(t.unaryFilter.field);\\n        return Ve.create(n, \\\"==\\\" /* EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      case \\\"IS_NOT_NAN\\\":\\n        const s = Bs(t.unaryFilter.field);\\n        return Ve.create(s, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            doubleValue: NaN\\n        });\\n\\n      case \\\"IS_NOT_NULL\\\":\\n        const i = Bs(t.unaryFilter.field);\\n        return Ve.create(i, \\\"!=\\\" /* NOT_EQUAL */ , {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        });\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\nfunction qs(t) {\\n    const e = [];\\n    return t.fields.forEach((t => e.push(t.canonicalString()))), {\\n        fieldPaths: e\\n    };\\n}\\n\\nfunction Ks(t) {\\n    // Resource names have at least 4 components (project ID, database ID)\\n    return t.length >= 4 && \\\"projects\\\" === t.get(0) && \\\"databases\\\" === t.get(2);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Encodes a resource path into a IndexedDb-compatible string form.\\n */\\nfunction Gs(t) {\\n    let e = \\\"\\\";\\n    for (let n = 0; n < t.length; n++) e.length > 0 && (e = js(e)), e = Qs(t.get(n), e);\\n    return js(e);\\n}\\n\\n/** Encodes a single segment of a resource path into the given result */ function Qs(t, e) {\\n    let n = e;\\n    const s = t.length;\\n    for (let e = 0; e < s; e++) {\\n        const s = t.charAt(e);\\n        switch (s) {\\n          case \\\"\\\\0\\\":\\n            n += \\\"\\u0001\\u0010\\\";\\n            break;\\n\\n          case \\\"\\u0001\\\":\\n            n += \\\"\\u0001\\u0011\\\";\\n            break;\\n\\n          default:\\n            n += s;\\n        }\\n    }\\n    return n;\\n}\\n\\n/** Encodes a path separator into the given result */ function js(t) {\\n    return t + \\\"\\u0001\\u0001\\\";\\n}\\n\\n/**\\n * Decodes the given IndexedDb-compatible string form of a resource path into\\n * a ResourcePath instance. Note that this method is not suitable for use with\\n * decoding resource names from the server; those are One Platform format\\n * strings.\\n */ function Ws(t) {\\n    // Event the empty path must encode as a path of at least length 2. A path\\n    // with exactly 2 must be the empty path.\\n    const e = t.length;\\n    if (U(e >= 2), 2 === e) return U(\\\"\\u0001\\\" === t.charAt(0) && \\\"\\u0001\\\" === t.charAt(1)), _t.emptyPath();\\n    // Escape characters cannot exist past the second-to-last position in the\\n    // source value.\\n        const n = e - 2, s = [];\\n    let i = \\\"\\\";\\n    for (let r = 0; r < e; ) {\\n        // The last two characters of a valid encoded path must be a separator, so\\n        // there must be an end to this segment.\\n        const e = t.indexOf(\\\"\\u0001\\\", r);\\n        (e < 0 || e > n) && L();\\n        switch (t.charAt(e + 1)) {\\n          case \\\"\\u0001\\\":\\n            const n = t.substring(r, e);\\n            let o;\\n            0 === i.length ? \\n            // Avoid copying for the common case of a segment that excludes \\\\0\\n            // and \\\\001\\n            o = n : (i += n, o = i, i = \\\"\\\"), s.push(o);\\n            break;\\n\\n          case \\\"\\u0010\\\":\\n            i += t.substring(r, e), i += \\\"\\\\0\\\";\\n            break;\\n\\n          case \\\"\\u0011\\\":\\n            // The escape character can be used in the output to encode itself.\\n            i += t.substring(r, e + 1);\\n            break;\\n\\n          default:\\n            L();\\n        }\\n        r = e + 2;\\n    }\\n    return new _t(s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zs = [ \\\"userId\\\", \\\"batchId\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Name of the IndexedDb object store.\\n *\\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\\n * older clients that only supported single locked access to the persistence\\n * layer.\\n */\\n/**\\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\\n * index to iterate over all at document mutations for a given path or lower.\\n */\\nfunction Hs(t, e) {\\n    return [ t, Gs(e) ];\\n}\\n\\n/**\\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\\n * and deleting into the DbDocumentMutations index.\\n */ function Js(t, e, n) {\\n    return [ t, Gs(e), n ];\\n}\\n\\n/**\\n * Because we store all the useful information for this store in the key,\\n * there is no useful information to store as the value. The raw (unencoded)\\n * path cannot be stored because IndexedDb doesn't store prototype\\n * information.\\n */ const Ys = {}, Xs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"readTime\\\", \\\"documentId\\\" ], Zs = [ \\\"prefixPath\\\", \\\"collectionGroup\\\", \\\"documentId\\\" ], ti = [ \\\"collectionGroup\\\", \\\"readTime\\\", \\\"prefixPath\\\", \\\"documentId\\\" ], ei = [ \\\"canonicalId\\\", \\\"targetId\\\" ], ni = [ \\\"targetId\\\", \\\"path\\\" ], si = [ \\\"path\\\", \\\"targetId\\\" ], ii = [ \\\"collectionId\\\", \\\"parent\\\" ], ri = [ \\\"indexId\\\", \\\"uid\\\" ], oi = [ \\\"uid\\\", \\\"sequenceNumber\\\" ], ui = [ \\\"indexId\\\", \\\"uid\\\", \\\"arrayValue\\\", \\\"directionalValue\\\", \\\"orderedDocumentKey\\\", \\\"documentKey\\\" ], ai = [ \\\"indexId\\\", \\\"uid\\\", \\\"orderedDocumentKey\\\" ], ci = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"documentId\\\" ], hi = [ \\\"userId\\\", \\\"collectionPath\\\", \\\"largestBatchId\\\" ], li = [ \\\"userId\\\", \\\"collectionGroup\\\", \\\"largestBatchId\\\" ], fi = [ ...[ ...[ ...[ ...[ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocuments\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\" ], \\\"clientMetadata\\\" ], \\\"remoteDocumentGlobal\\\" ], \\\"collectionParents\\\" ], \\\"bundles\\\", \\\"namedQueries\\\" ], di = [ ...fi, \\\"documentOverlays\\\" ], _i = [ \\\"mutationQueues\\\", \\\"mutations\\\", \\\"documentMutations\\\", \\\"remoteDocumentsV14\\\", \\\"targets\\\", \\\"owner\\\", \\\"targetGlobal\\\", \\\"targetDocuments\\\", \\\"clientMetadata\\\", \\\"remoteDocumentGlobal\\\", \\\"collectionParents\\\", \\\"bundles\\\", \\\"namedQueries\\\", \\\"documentOverlays\\\" ], wi = [ ..._i, \\\"indexConfiguration\\\", \\\"indexState\\\", \\\"indexEntries\\\" ];\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nconst mi = \\\"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.\\\";\\n\\n/**\\n * A base class representing a persistence transaction, encapsulating both the\\n * transaction's sequence numbers as well as a list of onCommitted listeners.\\n *\\n * When you call Persistence.runTransaction(), it will create a transaction and\\n * pass it to your callback. You then pass it to any method that operates\\n * on persistence.\\n */ class gi {\\n    constructor() {\\n        this.onCommittedListeners = [];\\n    }\\n    addOnCommittedListener(t) {\\n        this.onCommittedListeners.push(t);\\n    }\\n    raiseOnCommittedEvent() {\\n        this.onCommittedListeners.forEach((t => t()));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * PersistencePromise is essentially a re-implementation of Promise except\\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\\n * are executed synchronously when a PersistencePromise resolves rather than\\n * asynchronously (Promise implementations use setImmediate() or similar).\\n *\\n * This is necessary to interoperate with IndexedDB which will automatically\\n * commit transactions if control is returned to the event loop without\\n * synchronously initiating another operation on the transaction.\\n *\\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\\n * Promises.\\n */ class yi {\\n    constructor(t) {\\n        // NOTE: next/catchCallback will always point to our own wrapper functions,\\n        // not the user's raw next() or catch() callbacks.\\n        this.nextCallback = null, this.catchCallback = null, \\n        // When the operation resolves, we'll set result or error and mark isDone.\\n        this.result = void 0, this.error = void 0, this.isDone = !1, \\n        // Set to true when .then() or .catch() are called and prevents additional\\n        // chaining.\\n        this.callbackAttached = !1, t((t => {\\n            this.isDone = !0, this.result = t, this.nextCallback && \\n            // value should be defined unless T is Void, but we can't express\\n            // that in the type system.\\n            this.nextCallback(t);\\n        }), (t => {\\n            this.isDone = !0, this.error = t, this.catchCallback && this.catchCallback(t);\\n        }));\\n    }\\n    catch(t) {\\n        return this.next(void 0, t);\\n    }\\n    next(t, e) {\\n        return this.callbackAttached && L(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(e, this.error) : this.wrapSuccess(t, this.result) : new yi(((n, s) => {\\n            this.nextCallback = e => {\\n                this.wrapSuccess(t, e).next(n, s);\\n            }, this.catchCallback = t => {\\n                this.wrapFailure(e, t).next(n, s);\\n            };\\n        }));\\n    }\\n    toPromise() {\\n        return new Promise(((t, e) => {\\n            this.next(t, e);\\n        }));\\n    }\\n    wrapUserFunction(t) {\\n        try {\\n            const e = t();\\n            return e instanceof yi ? e : yi.resolve(e);\\n        } catch (t) {\\n            return yi.reject(t);\\n        }\\n    }\\n    wrapSuccess(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.resolve(e);\\n    }\\n    wrapFailure(t, e) {\\n        return t ? this.wrapUserFunction((() => t(e))) : yi.reject(e);\\n    }\\n    static resolve(t) {\\n        return new yi(((e, n) => {\\n            e(t);\\n        }));\\n    }\\n    static reject(t) {\\n        return new yi(((e, n) => {\\n            n(t);\\n        }));\\n    }\\n    static waitFor(\\n    // Accept all Promise types in waitFor().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t) {\\n        return new yi(((e, n) => {\\n            let s = 0, i = 0, r = !1;\\n            t.forEach((t => {\\n                ++s, t.next((() => {\\n                    ++i, r && i === s && e();\\n                }), (t => n(t)));\\n            })), r = !0, i === s && e();\\n        }));\\n    }\\n    /**\\n     * Given an array of predicate functions that asynchronously evaluate to a\\n     * boolean, implements a short-circuiting `or` between the results. Predicates\\n     * will be evaluated until one of them returns `true`, then stop. The final\\n     * result will be whether any of them returned `true`.\\n     */    static or(t) {\\n        let e = yi.resolve(!1);\\n        for (const n of t) e = e.next((t => t ? yi.resolve(t) : n()));\\n        return e;\\n    }\\n    static forEach(t, e) {\\n        const n = [];\\n        return t.forEach(((t, s) => {\\n            n.push(e.call(this, t, s));\\n        })), this.waitFor(n);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by SimpleDb.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\\n * specific object store.\\n */\\nclass pi {\\n    constructor(t, e) {\\n        this.action = t, this.transaction = e, this.aborted = !1, \\n        /**\\n         * A `Promise` that resolves with the result of the IndexedDb transaction.\\n         */\\n        this.At = new j, this.transaction.oncomplete = () => {\\n            this.At.resolve();\\n        }, this.transaction.onabort = () => {\\n            e.error ? this.At.reject(new Ei(t, e.error)) : this.At.resolve();\\n        }, this.transaction.onerror = e => {\\n            const n = Vi(e.target.error);\\n            this.At.reject(new Ei(t, n));\\n        };\\n    }\\n    static open(t, e, n, s) {\\n        try {\\n            return new pi(e, t.transaction(s, n));\\n        } catch (t) {\\n            throw new Ei(e, t);\\n        }\\n    }\\n    get Rt() {\\n        return this.At.promise;\\n    }\\n    abort(t) {\\n        t && this.At.reject(t), this.aborted || (O(\\\"SimpleDb\\\", \\\"Aborting transaction:\\\", t ? t.message : \\\"Client-initiated abort\\\"), \\n        this.aborted = !0, this.transaction.abort());\\n    }\\n    bt() {\\n        // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\\n        // speed up index DB processing if the event loop remains blocks.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        const t = this.transaction;\\n        this.aborted || \\\"function\\\" != typeof t.commit || t.commit();\\n    }\\n    /**\\n     * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\\n     * operations performed on the SimpleDbStore happen within the context of this\\n     * transaction and it cannot be used anymore once the transaction is\\n     * completed.\\n     *\\n     * Note that we can't actually enforce that the KeyType and ValueType are\\n     * correct, but they allow type safety through the rest of the consuming code.\\n     */    store(t) {\\n        const e = this.transaction.objectStore(t);\\n        return new Ri(e);\\n    }\\n}\\n\\n/**\\n * Provides a wrapper around IndexedDb with a simplified interface that uses\\n * Promise-like return values to chain operations. Real promises cannot be used\\n * since .then() continuations are executed asynchronously (e.g. via\\n * .setImmediate), which would cause IndexedDB to end the transaction.\\n * See PersistencePromise for more details.\\n */ class Ii {\\n    /*\\n     * Creates a new SimpleDb wrapper for IndexedDb database `name`.\\n     *\\n     * Note that `version` must not be a downgrade. IndexedDB does not support\\n     * downgrading the schema version. We currently do not support any way to do\\n     * versioning outside of IndexedDB's versioning mechanism, as only\\n     * version-upgrade transactions are allowed to do things like create\\n     * objectstores.\\n     */\\n    constructor(t, e, n) {\\n        this.name = t, this.version = e, this.Pt = n;\\n        // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\\n        // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\\n        // whatever reason it's much harder to hit after 12.2 so we only proactively\\n        // log on 12.2.\\n        12.2 === Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)()) && F(\\\"Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.\\\");\\n    }\\n    /** Deletes the specified database. */    static delete(t) {\\n        return O(\\\"SimpleDb\\\", \\\"Removing database:\\\", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();\\n    }\\n    /** Returns true if IndexedDB is available in the current environment. */    static vt() {\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIndexedDBAvailable)()) return !1;\\n        if (Ii.St()) return !0;\\n        // We extensively use indexed array values and compound keys,\\n        // which IE and Edge do not support. However, they still have indexedDB\\n        // defined on the window, so we need to check for them here and make sure\\n        // to return that persistence is not enabled for those browsers.\\n        // For tracking support of this feature, see here:\\n        // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\\n        // Check the UA string to find out the browser.\\n                const t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)(), e = Ii.Vt(t), n = 0 < e && e < 10, s = Ii.Dt(t), i = 0 < s && s < 4.5;\\n        // IE 10\\n        // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\\n        // IE 11\\n        // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\\n        // Edge\\n        // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\\n        // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\\n        // iOS Safari: Disable for users running iOS version < 10.\\n                return !(t.indexOf(\\\"MSIE \\\") > 0 || t.indexOf(\\\"Trident/\\\") > 0 || t.indexOf(\\\"Edge/\\\") > 0 || n || i);\\n    }\\n    /**\\n     * Returns true if the backing IndexedDB store is the Node IndexedDBShim\\n     * (see https://github.com/axemclion/IndexedDBShim).\\n     */    static St() {\\n        var t;\\n        return \\\"undefined\\\" != typeof process && \\\"YES\\\" === (null === (t = process.env) || void 0 === t ? void 0 : t.Ct);\\n    }\\n    /** Helper to get a typed SimpleDbStore from a transaction. */    static xt(t, e) {\\n        return t.store(e);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine iOS version. Returns -1 if not found. */\\n    static Vt(t) {\\n        const e = t.match(/i(?:phone|pad|pod) os ([\\\\d_]+)/i), n = e ? e[1].split(\\\"_\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    // visible for testing\\n    /** Parse User Agent to determine Android version. Returns -1 if not found. */\\n    static Dt(t) {\\n        const e = t.match(/Android ([\\\\d.]+)/i), n = e ? e[1].split(\\\".\\\").slice(0, 2).join(\\\".\\\") : \\\"-1\\\";\\n        return Number(n);\\n    }\\n    /**\\n     * Opens the specified database, creating or upgrading it if necessary.\\n     */    async Nt(t) {\\n        return this.db || (O(\\\"SimpleDb\\\", \\\"Opening database:\\\", this.name), this.db = await new Promise(((e, n) => {\\n            // TODO(mikelehen): Investigate browser compatibility.\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\\n            // suggests IE9 and older WebKit browsers handle upgrade\\n            // differently. They expect setVersion, as described here:\\n            // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\\n            const s = indexedDB.open(this.name, this.version);\\n            s.onsuccess = t => {\\n                const n = t.target.result;\\n                e(n);\\n            }, s.onblocked = () => {\\n                n(new Ei(t, \\\"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.\\\"));\\n            }, s.onerror = e => {\\n                const s = e.target.error;\\n                \\\"VersionError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.\\\")) : \\\"InvalidStateError\\\" === s.name ? n(new Q(G.FAILED_PRECONDITION, \\\"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: \\\" + s)) : n(new Ei(t, s));\\n            }, s.onupgradeneeded = t => {\\n                O(\\\"SimpleDb\\\", 'Database \\\"' + this.name + '\\\" requires upgrade from version:', t.oldVersion);\\n                const e = t.target.result;\\n                this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {\\n                    O(\\\"SimpleDb\\\", \\\"Database upgrade to version \\\" + this.version + \\\" complete\\\");\\n                }));\\n            };\\n        }))), this.Mt && (this.db.onversionchange = t => this.Mt(t)), this.db;\\n    }\\n    Ot(t) {\\n        this.Mt = t, this.db && (this.db.onversionchange = e => t(e));\\n    }\\n    async runTransaction(t, e, n, s) {\\n        const i = \\\"readonly\\\" === e;\\n        let r = 0;\\n        for (;;) {\\n            ++r;\\n            try {\\n                this.db = await this.Nt(t);\\n                const e = pi.open(this.db, t, i ? \\\"readonly\\\" : \\\"readwrite\\\", n), r = s(e).next((t => (e.bt(), \\n                t))).catch((t => (\\n                // Abort the transaction if there was an error.\\n                e.abort(t), yi.reject(t)))).toPromise();\\n                // As noted above, errors are propagated by aborting the transaction. So\\n                // we swallow any error here to avoid the browser logging it as unhandled.\\n                return r.catch((() => {})), \\n                // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\\n                // fire), but still return the original transactionFnResult back to the\\n                // caller.\\n                await e.Rt, r;\\n            } catch (t) {\\n                // TODO(schmidt-sebastian): We could probably be smarter about this and\\n                // not retry exceptions that are likely unrecoverable (such as quota\\n                // exceeded errors).\\n                // Note: We cannot use an instanceof check for FirestoreException, since the\\n                // exception is wrapped in a generic error by our async/await handling.\\n                const e = \\\"FirebaseError\\\" !== t.name && r < 3;\\n                if (O(\\\"SimpleDb\\\", \\\"Transaction failed with error:\\\", t.message, \\\"Retrying:\\\", e), \\n                this.close(), !e) return Promise.reject(t);\\n            }\\n        }\\n    }\\n    close() {\\n        this.db && this.db.close(), this.db = void 0;\\n    }\\n}\\n\\n/**\\n * A controller for iterating over a key range or index. It allows an iterate\\n * callback to delete the currently-referenced object, or jump to a new key\\n * within the key range or index.\\n */ class Ti {\\n    constructor(t) {\\n        this.Ft = t, this.$t = !1, this.Bt = null;\\n    }\\n    get isDone() {\\n        return this.$t;\\n    }\\n    get Lt() {\\n        return this.Bt;\\n    }\\n    set cursor(t) {\\n        this.Ft = t;\\n    }\\n    /**\\n     * This function can be called to stop iteration at any point.\\n     */    done() {\\n        this.$t = !0;\\n    }\\n    /**\\n     * This function can be called to skip to that next key, which could be\\n     * an index or a primary key.\\n     */    Ut(t) {\\n        this.Bt = t;\\n    }\\n    /**\\n     * Delete the current cursor value from the object store.\\n     *\\n     * NOTE: You CANNOT do this with a keysOnly query.\\n     */    delete() {\\n        return bi(this.Ft.delete());\\n    }\\n}\\n\\n/** An error that wraps exceptions that thrown during IndexedDB execution. */ class Ei extends Q {\\n    constructor(t, e) {\\n        super(G.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = \\\"IndexedDbTransactionError\\\";\\n    }\\n}\\n\\n/** Verifies whether `e` is an IndexedDbTransactionError. */ function Ai(t) {\\n    // Use name equality, as instanceof checks on errors don't work with errors\\n    // that wrap other errors.\\n    return \\\"IndexedDbTransactionError\\\" === t.name;\\n}\\n\\n/**\\n * A wrapper around an IDBObjectStore providing an API that:\\n *\\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\\n * methods for acting against the object store.\\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\\n * method return a PersistencePromise instead.\\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\\n */ class Ri {\\n    constructor(t) {\\n        this.store = t;\\n    }\\n    put(t, e) {\\n        let n;\\n        return void 0 !== e ? (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, t, e), n = this.store.put(e, t)) : (O(\\\"SimpleDb\\\", \\\"PUT\\\", this.store.name, \\\"<auto-key>\\\", t), \\n        n = this.store.put(t)), bi(n);\\n    }\\n    /**\\n     * Adds a new value into an Object Store and returns the new key. Similar to\\n     * IndexedDb's `add()`, this method will fail on primary key collisions.\\n     *\\n     * @param value - The object to write.\\n     * @returns The key of the value to add.\\n     */    add(t) {\\n        O(\\\"SimpleDb\\\", \\\"ADD\\\", this.store.name, t, t);\\n        return bi(this.store.add(t));\\n    }\\n    /**\\n     * Gets the object with the specified key from the specified store, or null\\n     * if no object exists with the specified key.\\n     *\\n     * @key The key of the object to get.\\n     * @returns The object with the specified key or null if no object exists.\\n     */    get(t) {\\n        // We're doing an unsafe cast to ValueType.\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return bi(this.store.get(t)).next((e => (\\n        // Normalize nonexistence to null.\\n        void 0 === e && (e = null), O(\\\"SimpleDb\\\", \\\"GET\\\", this.store.name, t, e), e)));\\n    }\\n    delete(t) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE\\\", this.store.name, t);\\n        return bi(this.store.delete(t));\\n    }\\n    /**\\n     * If we ever need more of the count variants, we can add overloads. For now,\\n     * all we need is to count everything in a store.\\n     *\\n     * Returns the number of rows in the store.\\n     */    count() {\\n        O(\\\"SimpleDb\\\", \\\"COUNT\\\", this.store.name);\\n        return bi(this.store.count());\\n    }\\n    qt(t, e) {\\n        const n = this.options(t, e);\\n        // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\\n        // 20% faster. Unfortunately, getAll() does not support custom indices.\\n                if (n.index || \\\"function\\\" != typeof this.store.getAll) {\\n            const t = this.cursor(n), e = [];\\n            return this.Kt(t, ((t, n) => {\\n                e.push(n);\\n            })).next((() => e));\\n        }\\n        {\\n            const t = this.store.getAll(n.range);\\n            return new yi(((e, n) => {\\n                t.onerror = t => {\\n                    n(t.target.error);\\n                }, t.onsuccess = t => {\\n                    e(t.target.result);\\n                };\\n            }));\\n        }\\n    }\\n    /**\\n     * Loads the first `count` elements from the provided index range. Loads all\\n     * elements if no limit is provided.\\n     */    Gt(t, e) {\\n        const n = this.store.getAll(t, null === e ? void 0 : e);\\n        return new yi(((t, e) => {\\n            n.onerror = t => {\\n                e(t.target.error);\\n            }, n.onsuccess = e => {\\n                t(e.target.result);\\n            };\\n        }));\\n    }\\n    Qt(t, e) {\\n        O(\\\"SimpleDb\\\", \\\"DELETE ALL\\\", this.store.name);\\n        const n = this.options(t, e);\\n        n.jt = !1;\\n        const s = this.cursor(n);\\n        return this.Kt(s, ((t, e, n) => n.delete()));\\n    }\\n    Wt(t, e) {\\n        let n;\\n        e ? n = t : (n = {}, e = t);\\n        const s = this.cursor(n);\\n        return this.Kt(s, e);\\n    }\\n    /**\\n     * Iterates over a store, but waits for the given callback to complete for\\n     * each entry before iterating the next entry. This allows the callback to do\\n     * asynchronous work to determine if this iteration should continue.\\n     *\\n     * The provided callback should return `true` to continue iteration, and\\n     * `false` otherwise.\\n     */    zt(t) {\\n        const e = this.cursor({});\\n        return new yi(((n, s) => {\\n            e.onerror = t => {\\n                const e = Vi(t.target.error);\\n                s(e);\\n            }, e.onsuccess = e => {\\n                const s = e.target.result;\\n                s ? t(s.primaryKey, s.value).next((t => {\\n                    t ? s.continue() : n();\\n                })) : n();\\n            };\\n        }));\\n    }\\n    Kt(t, e) {\\n        const n = [];\\n        return new yi(((s, i) => {\\n            t.onerror = t => {\\n                i(t.target.error);\\n            }, t.onsuccess = t => {\\n                const i = t.target.result;\\n                if (!i) return void s();\\n                const r = new Ti(i), o = e(i.primaryKey, i.value, r);\\n                if (o instanceof yi) {\\n                    const t = o.catch((t => (r.done(), yi.reject(t))));\\n                    n.push(t);\\n                }\\n                r.isDone ? s() : null === r.Lt ? i.continue() : i.continue(r.Lt);\\n            };\\n        })).next((() => yi.waitFor(n)));\\n    }\\n    options(t, e) {\\n        let n;\\n        return void 0 !== t && (\\\"string\\\" == typeof t ? n = t : e = t), {\\n            index: n,\\n            range: e\\n        };\\n    }\\n    cursor(t) {\\n        let e = \\\"next\\\";\\n        if (t.reverse && (e = \\\"prev\\\"), t.index) {\\n            const n = this.store.index(t.index);\\n            return t.jt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e);\\n        }\\n        return this.store.openCursor(t.range, e);\\n    }\\n}\\n\\n/**\\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\\n * handlers to resolve / reject the PersistencePromise as appropriate.\\n */ function bi(t) {\\n    return new yi(((e, n) => {\\n        t.onsuccess = t => {\\n            const n = t.target.result;\\n            e(n);\\n        }, t.onerror = t => {\\n            const e = Vi(t.target.error);\\n            n(e);\\n        };\\n    }));\\n}\\n\\n// Guard so we only report the error once.\\nlet Pi = !1;\\n\\nfunction Vi(t) {\\n    const e = Ii.Vt((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getUA)());\\n    if (e >= 12.2 && e < 13) {\\n        const e = \\\"An internal error was encountered in the Indexed Database server\\\";\\n        if (t.message.indexOf(e) >= 0) {\\n            // Wrap error in a more descriptive one.\\n            const t = new Q(\\\"internal\\\", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);\\n            return Pi || (Pi = !0, \\n            // Throw a global exception outside of this promise chain, for the user to\\n            // potentially catch.\\n            setTimeout((() => {\\n                throw t;\\n            }), 0)), t;\\n        }\\n    }\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class vi extends gi {\\n    constructor(t, e) {\\n        super(), this.Ht = t, this.currentSequenceNumber = e;\\n    }\\n}\\n\\nfunction Si(t, e) {\\n    const n = K(t);\\n    return Ii.xt(n.Ht, e);\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A batch of mutations that will be sent as one unit to the backend.\\n */ class Di {\\n    /**\\n     * @param batchId - The unique ID of this mutation batch.\\n     * @param localWriteTime - The original write time of this mutation.\\n     * @param baseMutations - Mutations that are used to populate the base\\n     * values when this mutation is applied locally. This can be used to locally\\n     * overwrite values that are persisted in the remote document cache. Base\\n     * mutations are never sent to the backend.\\n     * @param mutations - The user-provided mutations in this mutation batch.\\n     * User-provided mutations are applied both locally and remotely on the\\n     * backend.\\n     */\\n    constructor(t, e, n, s) {\\n        this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = s;\\n    }\\n    /**\\n     * Applies all the mutations in this MutationBatch to the specified document\\n     * to compute the state of the remote document\\n     *\\n     * @param document - The document to apply mutations to.\\n     * @param batchResult - The result of applying the MutationBatch to the\\n     * backend.\\n     */    applyToRemoteDocument(t, e) {\\n        const n = e.mutationResults;\\n        for (let e = 0; e < this.mutations.length; e++) {\\n            const s = this.mutations[e];\\n            if (s.key.isEqual(t.key)) {\\n                Pn(s, t, n[e]);\\n            }\\n        }\\n    }\\n    /**\\n     * Computes the local view of a document given all the mutations in this\\n     * batch.\\n     *\\n     * @param document - The document to apply mutations to.\\n     */    applyToLocalView(t) {\\n        // First, apply the base state. This allows us to apply non-idempotent\\n        // transform against a consistent set of values.\\n        for (const e of this.baseMutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n        // Second, apply all user-provided mutations.\\n                for (const e of this.mutations) e.key.isEqual(t.key) && Vn(e, t, this.localWriteTime);\\n    }\\n    /**\\n     * Computes the local view for all provided documents given the mutations in\\n     * this batch.\\n     */    applyToLocalDocumentSet(t) {\\n        // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\\n        // directly (as done in `applyToLocalView()`), we can reduce the complexity\\n        // to O(n).\\n        this.mutations.forEach((e => {\\n            const n = t.get(e.key), s = n;\\n            // TODO(mutabledocuments): This method should take a MutableDocumentMap\\n            // and we should remove this cast.\\n                        this.applyToLocalView(s), n.isValidDocument() || s.convertToNoDocument(ct.min());\\n        }));\\n    }\\n    keys() {\\n        return this.mutations.reduce(((t, e) => t.add(e.key)), Yn());\\n    }\\n    isEqual(t) {\\n        return this.batchId === t.batchId && ot(this.mutations, t.mutations, ((t, e) => Sn(t, e))) && ot(this.baseMutations, t.baseMutations, ((t, e) => Sn(t, e)));\\n    }\\n}\\n\\n/** The result of applying a mutation batch to the backend. */ class Ci {\\n    constructor(t, e, n, \\n    /**\\n     * A pre-computed mapping from each mutated document to the resulting\\n     * version.\\n     */\\n    s) {\\n        this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = s;\\n    }\\n    /**\\n     * Creates a new MutationBatchResult for the given batch and results. There\\n     * must be one result for each mutation in the batch. This static factory\\n     * caches a document=&gt;version mapping (docVersions).\\n     */    static from(t, e, n) {\\n        U(t.mutations.length === n.length);\\n        let s = Hn;\\n        const i = t.mutations;\\n        for (let t = 0; t < i.length; t++) s = s.insert(i[t].key, n[t].version);\\n        return new Ci(t, e, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Representation of an overlay computed by Firestore.\\n *\\n * Holds information about a mutation and the largest batch id in Firestore when\\n * the mutation was created.\\n */ class xi {\\n    constructor(t, e) {\\n        this.largestBatchId = t, this.mutation = e;\\n    }\\n    getKey() {\\n        return this.mutation.key;\\n    }\\n    isEqual(t) {\\n        return null !== t && this.mutation === t.mutation;\\n    }\\n    toString() {\\n        return `Overlay{\\\\n      largestBatchId: ${this.largestBatchId},\\\\n      mutation: ${this.mutation.toString()}\\\\n    }`;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable set of metadata that the local store tracks for each target.\\n */ class Ni {\\n    constructor(\\n    /** The target being listened to. */\\n    t, \\n    /**\\n     * The target ID to which the target corresponds; Assigned by the\\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\\n     */\\n    e, \\n    /** The purpose of the target. */\\n    n, \\n    /**\\n     * The sequence number of the last transaction during which this target data\\n     * was modified.\\n     */\\n    s, \\n    /** The latest snapshot version seen for this target. */\\n    i = ct.min()\\n    /**\\n     * The maximum snapshot version at which the associated view\\n     * contained no limbo documents.\\n     */ , r = ct.min()\\n    /**\\n     * An opaque, server-assigned token that allows watching a target to be\\n     * resumed after disconnecting without retransmitting all the data that\\n     * matches the target. The resume token essentially identifies a point in\\n     * time from which the server should resume sending results.\\n     */ , o = pt.EMPTY_BYTE_STRING) {\\n        this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i, \\n        this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;\\n    }\\n    /** Creates a new target data instance with an updated sequence number. */    withSequenceNumber(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated resume token and\\n     * snapshot version.\\n     */    withResumeToken(t, e) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t);\\n    }\\n    /**\\n     * Creates a new target data instance with an updated last limbo free\\n     * snapshot version number.\\n     */    withLastLimboFreeSnapshotVersion(t) {\\n        return new Ni(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Serializer for values stored in the LocalStore. */ class ki {\\n    constructor(t) {\\n        this.Jt = t;\\n    }\\n}\\n\\n/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {\\n    let n;\\n    if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {\\n        const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);\\n        n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();\\n    } else {\\n        if (!e.unknownDocument) return L();\\n        {\\n            const t = xt.fromSegments(e.unknownDocument.path), s = Bi(e.unknownDocument.version);\\n            n = ne.newUnknownDocument(t, s);\\n        }\\n    }\\n    return e.readTime && n.setReadTime(function(t) {\\n        const e = new at(t[0], t[1]);\\n        return ct.fromTimestamp(e);\\n    }(e.readTime)), n;\\n}\\n\\n/** Encodes a document for storage locally. */ function Oi(t, e) {\\n    const n = e.key, s = {\\n        prefixPath: n.getCollectionPath().popLast().toArray(),\\n        collectionGroup: n.collectionGroup,\\n        documentId: n.path.lastSegment(),\\n        readTime: Fi(e.readTime),\\n        hasCommittedMutations: e.hasCommittedMutations\\n    };\\n    if (e.isFoundDocument()) s.document = function(t, e) {\\n        return {\\n            name: ys(t, e.key),\\n            fields: e.data.value.mapValue.fields,\\n            updateTime: fs(t, e.version.toTimestamp())\\n        };\\n    }(t.Jt, e); else if (e.isNoDocument()) s.noDocument = {\\n        path: n.path.toArray(),\\n        readTime: $i(e.version)\\n    }; else {\\n        if (!e.isUnknownDocument()) return L();\\n        s.unknownDocument = {\\n            path: n.path.toArray(),\\n            version: $i(e.version)\\n        };\\n    }\\n    return s;\\n}\\n\\nfunction Fi(t) {\\n    const e = t.toTimestamp();\\n    return [ e.seconds, e.nanoseconds ];\\n}\\n\\nfunction $i(t) {\\n    const e = t.toTimestamp();\\n    return {\\n        seconds: e.seconds,\\n        nanoseconds: e.nanoseconds\\n    };\\n}\\n\\nfunction Bi(t) {\\n    const e = new at(t.seconds, t.nanoseconds);\\n    return ct.fromTimestamp(e);\\n}\\n\\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\\n/** Decodes a DbMutationBatch into a MutationBatch */\\nfunction Li(t, e) {\\n    const n = (e.baseMutations || []).map((e => Ss(t.Jt, e)));\\n    // Squash old transform mutations into existing patch or set mutations.\\n    // The replacement of representing `transforms` with `update_transforms`\\n    // on the SDK means that old `transform` mutations stored in IndexedDB need\\n    // to be updated to `update_transforms`.\\n    // TODO(b/174608374): Remove this code once we perform a schema migration.\\n        for (let t = 0; t < e.mutations.length - 1; ++t) {\\n        const n = e.mutations[t];\\n        if (t + 1 < e.mutations.length && void 0 !== e.mutations[t + 1].transform) {\\n            const s = e.mutations[t + 1];\\n            n.updateTransforms = s.transform.fieldTransforms, e.mutations.splice(t + 1, 1), \\n            ++t;\\n        }\\n    }\\n    const s = e.mutations.map((e => Ss(t.Jt, e))), i = at.fromMillis(e.localWriteTimeMs);\\n    return new Di(e.batchId, i, n, s);\\n}\\n\\n/** Decodes a DbTarget into TargetData */ function Ui(t) {\\n    const e = Bi(t.readTime), n = void 0 !== t.lastLimboFreeSnapshotVersion ? Bi(t.lastLimboFreeSnapshotVersion) : ct.min();\\n    let s;\\n    var i;\\n    return void 0 !== t.query.documents ? (U(1 === (i = t.query).documents.length), \\n    s = He(Ke(Ts(i.documents[0])))) : s = function(t) {\\n        return He(Ns(t));\\n    }(t.query), new Ni(s, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, e, n, pt.fromBase64String(t.resumeToken));\\n}\\n\\n/** Encodes TargetData into a DbTarget for storage locally. */ function qi(t, e) {\\n    const n = $i(e.snapshotVersion), s = $i(e.lastLimboFreeSnapshotVersion);\\n    let i;\\n    i = Ae(e.target) ? Cs(t.Jt, e.target) : xs(t.Jt, e.target);\\n    // We can't store the resumeToken as a ByteString in IndexedDb, so we\\n    // convert it to a base64 string for storage.\\n        const r = e.resumeToken.toBase64();\\n    // lastListenSequenceNumber is always 0 until we do real GC.\\n        return {\\n        targetId: e.targetId,\\n        canonicalId: Ie(e.target),\\n        readTime: n,\\n        resumeToken: r,\\n        lastListenSequenceNumber: e.sequenceNumber,\\n        lastLimboFreeSnapshotVersion: s,\\n        query: i\\n    };\\n}\\n\\n/**\\n * A helper function for figuring out what kind of query has been stored.\\n */\\n/**\\n * Encodes a `BundledQuery` from bundle proto to a Query object.\\n *\\n * This reconstructs the original query used to build the bundle being loaded,\\n * including features exists only in SDKs (for example: limit-to-last).\\n */\\nfunction Ki(t) {\\n    const e = Ns({\\n        parent: t.parent,\\n        structuredQuery: t.structuredQuery\\n    });\\n    return \\\"LAST\\\" === t.limitType ? Je(e, e.limit, \\\"L\\\" /* Last */) : e;\\n}\\n\\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\\nfunction Gi(t, e) {\\n    return new xi(e.largestBatchId, Ss(t.Jt, e.overlayMutation));\\n}\\n\\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\\n/**\\n * Returns the DbDocumentOverlayKey corresponding to the given user and\\n * document key.\\n */\\nfunction Qi(t, e) {\\n    const n = e.path.lastSegment();\\n    return [ t, Gs(e.path.popLast()), n ];\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass ji {\\n    getBundleMetadata(t, e) {\\n        return Wi(t).get(e).next((t => {\\n            if (t) return {\\n                id: (e = t).bundleId,\\n                createTime: Bi(e.createTime),\\n                version: e.version\\n            };\\n            /** Encodes a DbBundle to a BundleMetadata object. */\\n            var e;\\n            /** Encodes a BundleMetadata to a DbBundle. */        }));\\n    }\\n    saveBundleMetadata(t, e) {\\n        return Wi(t).put({\\n            bundleId: (n = e).id,\\n            createTime: $i(ws(n.createTime)),\\n            version: n.version\\n        });\\n        var n;\\n        /** Encodes a DbNamedQuery to a NamedQuery. */    }\\n    getNamedQuery(t, e) {\\n        return zi(t).get(e).next((t => {\\n            if (t) return {\\n                name: (e = t).name,\\n                query: Ki(e.bundledQuery),\\n                readTime: Bi(e.readTime)\\n            };\\n            var e;\\n            /** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */        }));\\n    }\\n    saveNamedQuery(t, e) {\\n        return zi(t).put(function(t) {\\n            return {\\n                name: t.name,\\n                readTime: $i(ws(t.readTime)),\\n                bundledQuery: t.bundledQuery\\n            };\\n        }(e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the bundles object store.\\n */ function Wi(t) {\\n    return Si(t, \\\"bundles\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\\n */ function zi(t) {\\n    return Si(t, \\\"namedQueries\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implementation of DocumentOverlayCache using IndexedDb.\\n */ class Hi {\\n    /**\\n     * @param serializer - The document serializer.\\n     * @param userId - The userId for which we are accessing overlays.\\n     */\\n    constructor(t, e) {\\n        this.M = t, this.userId = e;\\n    }\\n    static Yt(t, e) {\\n        const n = e.uid || \\\"\\\";\\n        return new Hi(t, n);\\n    }\\n    getOverlay(t, e) {\\n        return Ji(t).get(Qi(this.userId, e)).next((t => t ? Gi(this.M, t) : null));\\n    }\\n    saveOverlays(t, e, n) {\\n        const s = [];\\n        return n.forEach(((n, i) => {\\n            const r = new xi(e, i);\\n            s.push(this.Xt(t, r));\\n        })), yi.waitFor(s);\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = new Set;\\n        // Get the set of unique collection paths.\\n                e.forEach((t => s.add(Gs(t.getCollectionPath()))));\\n        const i = [];\\n        return s.forEach((e => {\\n            const s = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, n + 1 ], \\n            /*lowerOpen=*/ !1, \\n            /*upperOpen=*/ !0);\\n            i.push(Ji(t).Qt(\\\"collectionPathOverlayIndex\\\", s));\\n        })), yi.waitFor(i);\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = Gs(e), r = IDBKeyRange.bound([ this.userId, i, n ], [ this.userId, i, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).qt(\\\"collectionPathOverlayIndex\\\", r).next((t => {\\n            for (const e of t) {\\n                const t = Gi(this.M, e);\\n                s.set(t.getKey(), t);\\n            }\\n            return s;\\n        }));\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        const i = zn();\\n        let r;\\n        // We want batch IDs larger than `sinceBatchId`, and so the lower bound\\n        // is not inclusive.\\n                const o = IDBKeyRange.bound([ this.userId, e, n ], [ this.userId, e, Number.POSITIVE_INFINITY ], \\n        /*lowerOpen=*/ !0);\\n        return Ji(t).Wt({\\n            index: \\\"collectionGroupOverlayIndex\\\",\\n            range: o\\n        }, ((t, e, n) => {\\n            // We do not want to return partial batch overlays, even if the size\\n            // of the result set exceeds the given `count` argument. Therefore, we\\n            // continue to aggregate results even after the result size exceeds\\n            // `count` if there are more overlays from the `currentBatchId`.\\n            const o = Gi(this.M, e);\\n            i.size() < s || o.largestBatchId === r ? (i.set(o.getKey(), o), r = o.largestBatchId) : n.done();\\n        })).next((() => i));\\n    }\\n    Xt(t, e) {\\n        return Ji(t).put(function(t, e, n) {\\n            const [s, i, r] = Qi(e, n.mutation.key);\\n            return {\\n                userId: e,\\n                collectionPath: i,\\n                documentId: r,\\n                collectionGroup: n.mutation.key.getCollectionGroup(),\\n                largestBatchId: n.largestBatchId,\\n                overlayMutation: vs(t.Jt, n.mutation)\\n            };\\n        }(this.M, this.userId, e));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document overlay object store.\\n */ function Ji(t) {\\n    return Si(t, \\\"documentOverlays\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// Note: This code is copied from the backend. Code that is not used by\\n// Firestore was removed.\\n/** Firestore index value writer.  */\\nclass Yi {\\n    constructor() {}\\n    // The write methods below short-circuit writing terminators for values\\n    // containing a (terminating) truncated value.\\n    // As an example, consider the resulting encoding for:\\n    // [\\\"bar\\\", [2, \\\"foo\\\"]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TERM, TERM, TERM)\\n    // [\\\"bar\\\", [2, truncated(\\\"foo\\\")]] -> (STRING, \\\"bar\\\", TERM, ARRAY, NUMBER, 2, STRING, \\\"foo\\\", TRUNC)\\n    // [\\\"bar\\\", truncated([\\\"foo\\\"])] -> (STRING, \\\"bar\\\", TERM, ARRAY. STRING, \\\"foo\\\", TERM, TRUNC)\\n    /** Writes an index value.  */\\n    Zt(t, e) {\\n        this.te(t, e), \\n        // Write separator to split index values\\n        // (see go/firestore-storage-format#encodings).\\n        e.ee();\\n    }\\n    te(t, e) {\\n        if (\\\"nullValue\\\" in t) this.ne(e, 5); else if (\\\"booleanValue\\\" in t) this.ne(e, 10), \\n        e.se(t.booleanValue ? 1 : 0); else if (\\\"integerValue\\\" in t) this.ne(e, 15), e.se(Et(t.integerValue)); else if (\\\"doubleValue\\\" in t) {\\n            const n = Et(t.doubleValue);\\n            isNaN(n) ? this.ne(e, 13) : (this.ne(e, 15), Dt(n) ? \\n            // -0.0, 0 and 0.0 are all considered the same\\n            e.se(0) : e.se(n));\\n        } else if (\\\"timestampValue\\\" in t) {\\n            const n = t.timestampValue;\\n            this.ne(e, 20), \\\"string\\\" == typeof n ? e.ie(n) : (e.ie(`${n.seconds || \\\"\\\"}`), e.se(n.nanos || 0));\\n        } else if (\\\"stringValue\\\" in t) this.re(t.stringValue, e), this.oe(e); else if (\\\"bytesValue\\\" in t) this.ne(e, 30), \\n        e.ue(At(t.bytesValue)), this.oe(e); else if (\\\"referenceValue\\\" in t) this.ae(t.referenceValue, e); else if (\\\"geoPointValue\\\" in t) {\\n            const n = t.geoPointValue;\\n            this.ne(e, 45), e.se(n.latitude || 0), e.se(n.longitude || 0);\\n        } else \\\"mapValue\\\" in t ? Ht(t) ? this.ne(e, Number.MAX_SAFE_INTEGER) : (this.ce(t.mapValue, e), \\n        this.oe(e)) : \\\"arrayValue\\\" in t ? (this.he(t.arrayValue, e), this.oe(e)) : L();\\n    }\\n    re(t, e) {\\n        this.ne(e, 25), this.le(t, e);\\n    }\\n    le(t, e) {\\n        e.ie(t);\\n    }\\n    ce(t, e) {\\n        const n = t.fields || {};\\n        this.ne(e, 55);\\n        for (const t of Object.keys(n)) this.re(t, e), this.te(n[t], e);\\n    }\\n    he(t, e) {\\n        const n = t.values || [];\\n        this.ne(e, 50);\\n        for (const t of n) this.te(t, e);\\n    }\\n    ae(t, e) {\\n        this.ne(e, 37);\\n        xt.fromName(t).path.forEach((t => {\\n            this.ne(e, 60), this.le(t, e);\\n        }));\\n    }\\n    ne(t, e) {\\n        t.se(e);\\n    }\\n    oe(t) {\\n        // While the SDK does not implement truncation, the truncation marker is\\n        // used to terminate all variable length values (which are strings, bytes,\\n        // references, arrays and maps).\\n        t.se(2);\\n    }\\n}\\n\\nYi.fe = new Yi;\\n\\n/**\\n * Counts the number of zeros in a byte.\\n *\\n * Visible for testing.\\n */\\nfunction Xi(t) {\\n    if (0 === t) return 8;\\n    let e = 0;\\n    return t >> 4 == 0 && (\\n    // Test if the first four bits are zero.\\n    e += 4, t <<= 4), t >> 6 == 0 && (\\n    // Test if the first two (or next two) bits are zero.\\n    e += 2, t <<= 2), t >> 7 == 0 && (\\n    // Test if the remaining bit is zero.\\n    e += 1), e;\\n}\\n\\n/** Counts the number of leading zeros in the given byte array. */\\n/**\\n * Returns the number of bytes required to store \\\"value\\\". Leading zero bytes\\n * are skipped.\\n */\\nfunction Zi(t) {\\n    // This is just the number of bytes for the unsigned representation of the number.\\n    const e = 64 - function(t) {\\n        let e = 0;\\n        for (let n = 0; n < 8; ++n) {\\n            const s = Xi(255 & t[n]);\\n            if (e += s, 8 !== s) break;\\n        }\\n        return e;\\n    }(t);\\n    return Math.ceil(e / 8);\\n}\\n\\n/**\\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\\n * behavior defined by the backend.\\n *\\n * The code is ported from its Java counterpart.\\n */ class tr {\\n    constructor() {\\n        this.buffer = new Uint8Array(1024), this.position = 0;\\n    }\\n    de(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this._e(n.value), n = e.next();\\n        this.we();\\n    }\\n    me(t) {\\n        const e = t[Symbol.iterator]();\\n        let n = e.next();\\n        for (;!n.done; ) this.ge(n.value), n = e.next();\\n        this.ye();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, ascending. */    pe(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this._e(t); else if (t < 2048) this._e(960 | t >>> 6), this._e(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this._e(480 | t >>> 12), \\n            this._e(128 | 63 & t >>> 6), this._e(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this._e(240 | t >>> 18), this._e(128 | 63 & t >>> 12), this._e(128 | 63 & t >>> 6), \\n                this._e(128 | 63 & t);\\n            }\\n        }\\n        this.we();\\n    }\\n    /** Writes utf8 bytes into this byte sequence, descending */    Ie(t) {\\n        for (const e of t) {\\n            const t = e.charCodeAt(0);\\n            if (t < 128) this.ge(t); else if (t < 2048) this.ge(960 | t >>> 6), this.ge(128 | 63 & t); else if (e < \\\"\\\\ud800\\\" || \\\"\\\\udbff\\\" < e) this.ge(480 | t >>> 12), \\n            this.ge(128 | 63 & t >>> 6), this.ge(128 | 63 & t); else {\\n                const t = e.codePointAt(0);\\n                this.ge(240 | t >>> 18), this.ge(128 | 63 & t >>> 12), this.ge(128 | 63 & t >>> 6), \\n                this.ge(128 | 63 & t);\\n            }\\n        }\\n        this.ye();\\n    }\\n    Te(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // actual value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = 255 & n;\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = 255 & e[t];\\n    }\\n    Re(t) {\\n        // Values are encoded with a single byte length prefix, followed by the\\n        // inverted value in big-endian format with leading 0 bytes dropped.\\n        const e = this.Ee(t), n = Zi(e);\\n        this.Ae(1 + n), this.buffer[this.position++] = ~(255 & n);\\n        // Write the length\\n        for (let t = e.length - n; t < e.length; ++t) this.buffer[this.position++] = ~(255 & e[t]);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts after all other byte\\n     * sequences written in ascending order.\\n     */    be() {\\n        this.Pe(255), this.Pe(255);\\n    }\\n    /**\\n     * Writes the \\\"infinity\\\" byte sequence that sorts before all other byte\\n     * sequences written in descending order.\\n     */    Ve() {\\n        this.ve(255), this.ve(255);\\n    }\\n    /**\\n     * Resets the buffer such that it is the same as when it was newly\\n     * constructed.\\n     */    reset() {\\n        this.position = 0;\\n    }\\n    seed(t) {\\n        this.Ae(t.length), this.buffer.set(t, this.position), this.position += t.length;\\n    }\\n    /** Makes a copy of the encoded bytes in this buffer.  */    Se() {\\n        return this.buffer.slice(0, this.position);\\n    }\\n    /**\\n     * Encodes `val` into an encoding so that the order matches the IEEE 754\\n     * floating-point comparison results with the following exceptions:\\n     *   -0.0 < 0.0\\n     *   all non-NaN < NaN\\n     *   NaN = NaN\\n     */    Ee(t) {\\n        const e = \\n        /** Converts a JavaScript number to a byte array (using big endian encoding). */\\n        function(t) {\\n            const e = new DataView(new ArrayBuffer(8));\\n            return e.setFloat64(0, t, /* littleEndian= */ !1), new Uint8Array(e.buffer);\\n        }(t), n = 0 != (128 & e[0]);\\n        // Check if the first bit is set. We use a bit mask since value[0] is\\n        // encoded as a number from 0 to 255.\\n                // Revert the two complement to get natural ordering\\n        e[0] ^= n ? 255 : 128;\\n        for (let t = 1; t < e.length; ++t) e[t] ^= n ? 255 : 0;\\n        return e;\\n    }\\n    /** Writes a single byte ascending to the buffer. */    _e(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);\\n    }\\n    /** Writes a single byte descending to the buffer.  */    ge(t) {\\n        const e = 255 & t;\\n        0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);\\n    }\\n    we() {\\n        this.Pe(0), this.Pe(1);\\n    }\\n    ye() {\\n        this.ve(0), this.ve(1);\\n    }\\n    Pe(t) {\\n        this.Ae(1), this.buffer[this.position++] = t;\\n    }\\n    ve(t) {\\n        this.Ae(1), this.buffer[this.position++] = ~t;\\n    }\\n    Ae(t) {\\n        const e = t + this.position;\\n        if (e <= this.buffer.length) return;\\n        // Try doubling.\\n                let n = 2 * this.buffer.length;\\n        // Still not big enough? Just allocate the right size.\\n                n < e && (n = e);\\n        // Create the new buffer.\\n                const s = new Uint8Array(n);\\n        s.set(this.buffer), // copy old data\\n        this.buffer = s;\\n    }\\n}\\n\\nclass er {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.de(t);\\n    }\\n    ie(t) {\\n        this.De.pe(t);\\n    }\\n    se(t) {\\n        this.De.Te(t);\\n    }\\n    ee() {\\n        this.De.be();\\n    }\\n}\\n\\nclass nr {\\n    constructor(t) {\\n        this.De = t;\\n    }\\n    ue(t) {\\n        this.De.me(t);\\n    }\\n    ie(t) {\\n        this.De.Ie(t);\\n    }\\n    se(t) {\\n        this.De.Re(t);\\n    }\\n    ee() {\\n        this.De.Ve();\\n    }\\n}\\n\\n/**\\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\\n * actual encoding.\\n */ class sr {\\n    constructor() {\\n        this.De = new tr, this.Ce = new er(this.De), this.xe = new nr(this.De);\\n    }\\n    seed(t) {\\n        this.De.seed(t);\\n    }\\n    Ne(t) {\\n        return 0 /* ASCENDING */ === t ? this.Ce : this.xe;\\n    }\\n    Se() {\\n        return this.De.Se();\\n    }\\n    reset() {\\n        this.De.reset();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Represents an index entry saved by the SDK in persisted storage. */ class ir {\\n    constructor(t, e, n, s) {\\n        this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;\\n    }\\n    /**\\n     * Returns an IndexEntry entry that sorts immediately after the current\\n     * directional value.\\n     */    ke() {\\n        const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);\\n        return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1], \\n        new ir(this.indexId, this.documentKey, this.arrayValue, n);\\n    }\\n}\\n\\nfunction rr(t, e) {\\n    let n = t.indexId - e.indexId;\\n    return 0 !== n ? n : (n = or(t.arrayValue, e.arrayValue), 0 !== n ? n : (n = or(t.directionalValue, e.directionalValue), \\n    0 !== n ? n : xt.comparator(t.documentKey, e.documentKey)));\\n}\\n\\nfunction or(t, e) {\\n    for (let n = 0; n < t.length && n < e.length; ++n) {\\n        const s = t[n] - e[n];\\n        if (0 !== s) return s;\\n    }\\n    return t.length - e.length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A light query planner for Firestore.\\n *\\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\\n * determines whether a given index can be used to serve the specified target.\\n *\\n * The following table showcases some possible index configurations:\\n *\\n * Query                                               | Index\\n * -----------------------------------------------------------------------------\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\\n */ class ur {\\n    constructor(t) {\\n        this.collectionId = null != t.collectionGroup ? t.collectionGroup : t.path.lastSegment(), \\n        this.Me = t.orderBy, this.Oe = [];\\n        for (const e of t.filters) {\\n            const t = e;\\n            t.S() ? this.Fe = t : this.Oe.push(t);\\n        }\\n    }\\n    /**\\n     * Returns whether the index can be used to serve the TargetIndexMatcher's\\n     * target.\\n     *\\n     * An index is considered capable of serving the target when:\\n     * - The target uses all index segments for its filters and orderBy clauses.\\n     *   The target can have additional filter and orderBy clauses, but not\\n     *   fewer.\\n     * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\\n     *   have a corresponding `CONTAINS` segment.\\n     * - All directional index segments can be mapped to the target as a series of\\n     *   equality filters, a single inequality filter and a series of orderBy\\n     *   clauses.\\n     * - The segments that represent the equality filters may appear out of order.\\n     * - The optional segment for the inequality filter must appear after all\\n     *   equality segments.\\n     * - The segments that represent that orderBy clause of the target must appear\\n     *   in order after all equality and inequality segments. Single orderBy\\n     *   clauses cannot be skipped, but a continuous orderBy suffix may be\\n     *   omitted.\\n     */    $e(t) {\\n        // If there is an array element, find a matching filter.\\n        const e = ie(t);\\n        if (void 0 !== e && !this.Be(e)) return !1;\\n        const n = re(t);\\n        let s = 0, i = 0;\\n        // Process all equalities first. Equalities can appear out of order.\\n        for (;s < n.length && this.Be(n[s]); ++s) ;\\n        // If we already have processed all segments, all segments are used to serve\\n        // the equality filters and we do not need to map any segments to the\\n        // target's inequality and orderBy clauses.\\n                if (s === n.length) return !0;\\n        // If there is an inequality filter, the next segment must match both the\\n        // filter and the first orderBy clause.\\n                if (void 0 !== this.Fe) {\\n            const t = n[s];\\n            if (!this.Le(this.Fe, t) || !this.Ue(this.Me[i++], t)) return !1;\\n            ++s;\\n        }\\n        // All remaining segments need to represent the prefix of the target's\\n        // orderBy.\\n                for (;s < n.length; ++s) {\\n            const t = n[s];\\n            if (i >= this.Me.length || !this.Ue(this.Me[i++], t)) return !1;\\n        }\\n        return !0;\\n    }\\n    Be(t) {\\n        for (const e of this.Oe) if (this.Le(e, t)) return !0;\\n        return !1;\\n    }\\n    Le(t, e) {\\n        if (void 0 === t || !t.field.isEqual(e.fieldPath)) return !1;\\n        const n = \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op;\\n        return 2 /* CONTAINS */ === e.kind === n;\\n    }\\n    Ue(t, e) {\\n        return !!t.field.isEqual(e.fieldPath) && (0 /* ASCENDING */ === e.kind && \\\"asc\\\" /* ASCENDING */ === t.dir || 1 /* DESCENDING */ === e.kind && \\\"desc\\\" /* DESCENDING */ === t.dir);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of IndexManager.\\n */ class ar {\\n    constructor() {\\n        this.qe = new cr;\\n    }\\n    addToCollectionParentIndex(t, e) {\\n        return this.qe.add(e), yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        return yi.resolve(this.qe.getEntries(e));\\n    }\\n    addFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    deleteFieldIndex(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getIndexType(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(0 /* NONE */);\\n    }\\n    getFieldIndexes(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve([]);\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve(null);\\n    }\\n    getMinOffset(t, e) {\\n        return yi.resolve(he.min());\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n    updateIndexEntries(t, e) {\\n        // Field indices are not supported with memory persistence.\\n        return yi.resolve();\\n    }\\n}\\n\\n/**\\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\\n * in indexeddb_schema.ts\\n */ class cr {\\n    constructor() {\\n        this.index = {};\\n    }\\n    // Returns false if the entry already existed.\\n    add(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e] || new we(_t.comparator), i = !s.has(n);\\n        return this.index[e] = s.add(n), i;\\n    }\\n    has(t) {\\n        const e = t.lastSegment(), n = t.popLast(), s = this.index[e];\\n        return s && s.has(n);\\n    }\\n    getEntries(t) {\\n        return (this.index[t] || new we(_t.comparator)).toArray();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const hr = new Uint8Array(0);\\n\\n/**\\n * A persisted implementation of IndexManager.\\n *\\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\\n * data as it supports multi-tab access.\\n */\\nclass lr {\\n    constructor(t, e) {\\n        this.user = t, this.databaseId = e, \\n        /**\\n         * An in-memory copy of the index entries we've already written since the SDK\\n         * launched. Used to avoid re-writing the same entry repeatedly.\\n         *\\n         * This is *NOT* a complete cache of what's in persistence and so can never be\\n         * used to satisfy reads.\\n         */\\n        this.Ke = new cr, \\n        /**\\n         * Maps from a target to its equivalent list of sub-targets. Each sub-target\\n         * contains only one term from the target's disjunctive normal form (DNF).\\n         */\\n        this.Ge = new Kn((t => Ie(t)), ((t, e) => Ee(t, e))), this.uid = t.uid || \\\"\\\";\\n    }\\n    /**\\n     * Adds a new entry to the collection parent index.\\n     *\\n     * Repeated calls for the same collectionPath should be avoided within a\\n     * transaction as IndexedDbIndexManager only caches writes once a transaction\\n     * has been committed.\\n     */    addToCollectionParentIndex(t, e) {\\n        if (!this.Ke.has(e)) {\\n            const n = e.lastSegment(), s = e.popLast();\\n            t.addOnCommittedListener((() => {\\n                // Add the collection to the in memory cache only if the transaction was\\n                // successfully committed.\\n                this.Ke.add(e);\\n            }));\\n            const i = {\\n                collectionId: n,\\n                parent: Gs(s)\\n            };\\n            return fr(t).put(i);\\n        }\\n        return yi.resolve();\\n    }\\n    getCollectionParents(t, e) {\\n        const n = [], s = IDBKeyRange.bound([ e, \\\"\\\" ], [ ut(e), \\\"\\\" ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return fr(t).qt(s).next((t => {\\n            for (const s of t) {\\n                // This collectionId guard shouldn't be necessary (and isn't as long\\n                // as we're running in a real browser), but there's a bug in\\n                // indexeddbshim that breaks our range in our tests running in node:\\n                // https://github.com/axemclion/IndexedDBShim/issues/334\\n                if (s.collectionId !== e) break;\\n                n.push(Ws(s.parent));\\n            }\\n            return n;\\n        }));\\n    }\\n    addFieldIndex(t, e) {\\n        // TODO(indexing): Verify that the auto-incrementing index ID works in\\n        // Safari & Firefox.\\n        const n = _r(t), s = function(t) {\\n            return {\\n                indexId: t.indexId,\\n                collectionGroup: t.collectionGroup,\\n                fields: t.fields.map((t => [ t.fieldPath.canonicalString(), t.kind ]))\\n            };\\n        }(e);\\n        // `indexId` is auto-populated by IndexedDb\\n        return delete s.indexId, n.add(s).next();\\n    }\\n    deleteFieldIndex(t, e) {\\n        const n = _r(t), s = wr(t), i = dr(t);\\n        return n.delete(e.indexId).next((() => s.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0)))).next((() => i.delete(IDBKeyRange.bound([ e.indexId ], [ e.indexId + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0))));\\n    }\\n    getDocumentsMatchingTarget(t, e) {\\n        const n = dr(t);\\n        let s = !0;\\n        const i = new Map;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            s && (s = !!t), i.set(e, t);\\n        })))).next((() => {\\n            if (s) {\\n                let t = Yn();\\n                const s = [];\\n                return yi.forEach(i, ((i, r) => {\\n                    /** Returns a debug representation of the field index */\\n                    var o;\\n                    O(\\\"IndexedDbIndexManager\\\", `Using index ${o = i, `id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((t => `${t.fieldPath}:${t.kind}`)).join(\\\",\\\")}`} to execute ${Ie(e)}`);\\n                    const u = function(t, e) {\\n                        const n = ie(e);\\n                        if (void 0 === n) return null;\\n                        for (const e of Re(t, n.fieldPath)) switch (e.op) {\\n                          case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                            return e.value.arrayValue.values || [];\\n\\n                          case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                            return [ e.value ];\\n                            // Remaining filters are not array filters.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns the list of values that are used in != or NOT_IN filters. Returns\\n * `null` if there are no such filters.\\n */ (r, i), a = function(t, e) {\\n                        const n = new Map;\\n                        for (const s of re(e)) for (const e of Re(t, s.fieldPath)) switch (e.op) {\\n                          case \\\"==\\\" /* EQUAL */ :\\n                          case \\\"in\\\" /* IN */ :\\n                            // Encode equality prefix, which is encoded in the index value before\\n                            // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\\n                            // `value != 'ab'`).\\n                            n.set(s.fieldPath.canonicalString(), e.value);\\n                            break;\\n\\n                          case \\\"not-in\\\" /* NOT_IN */ :\\n                          case \\\"!=\\\" /* NOT_EQUAL */ :\\n                            // NotIn/NotEqual is always a suffix. There cannot be any remaining\\n                            // segments and hence we can return early here.\\n                            return n.set(s.fieldPath.canonicalString(), e.value), Array.from(n.values());\\n                            // Remaining filters cannot be used as notIn bounds.\\n                                                }\\n                        return null;\\n                    }\\n                    /**\\n * Returns a lower bound of field values that can be used as a starting point to\\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\\n * exists.\\n */ (r, i), c = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve a lower bound if there is a suitable filter or\\n                        // startAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }\\n                    /**\\n * Returns an upper bound of field values that can be used as an ending point\\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\\n * upper bound exists.\\n */ (r, i), h = function(t, e) {\\n                        const n = [];\\n                        let s = !0;\\n                        // For each segment, retrieve an upper bound if there is a suitable filter or\\n                        // endAt.\\n                                                for (const i of re(e)) {\\n                            const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);\\n                            n.push(e.value), s && (s = e.inclusive);\\n                        }\\n                        return new Oe(n, s);\\n                    }(r, i), l = this.We(i, r, c), f = this.We(i, r, h), d = this.ze(i, r, a), _ = this.He(i.indexId, u, l, c.inclusive, f, h.inclusive, d);\\n                    return yi.forEach(_, (i => n.Gt(i, e.limit).next((e => {\\n                        e.forEach((e => {\\n                            const n = xt.fromSegments(e.documentKey);\\n                            t.has(n) || (t = t.add(n), s.push(n));\\n                        }));\\n                    }))));\\n                })).next((() => s));\\n            }\\n            return yi.resolve(null);\\n        }));\\n    }\\n    Qe(t) {\\n        let e = this.Ge.get(t);\\n        return e || (\\n        // TODO(orquery): Implement DNF transform\\n        e = [ t ], this.Ge.set(t, e), e);\\n    }\\n    /**\\n     * Constructs a key range query on `DbIndexEntryStore` that unions all\\n     * bounds.\\n     */    He(t, e, n, s, i, r, o) {\\n        // The number of total index scans we union together. This is similar to a\\n        // distributed normal form, but adapted for array values. We create a single\\n        // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\\n        // combined with the values from the query bounds.\\n        const u = (null != e ? e.length : 1) * Math.max(n.length, i.length), a = u / (null != e ? e.length : 1), c = [];\\n        for (let h = 0; h < u; ++h) {\\n            const u = e ? this.Je(e[h / a]) : hr, l = this.Ye(t, u, n[h % a], s), f = this.Xe(t, u, i[h % a], r), d = o.map((e => this.Ye(t, u, e, \\n            /* inclusive= */ !0)));\\n            c.push(...this.createRange(l, f, d));\\n        }\\n        return c;\\n    }\\n    /** Generates the lower bound for `arrayValue` and `directionalValue`. */    Ye(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i : i.ke();\\n    }\\n    /** Generates the upper bound for `arrayValue` and `directionalValue`. */    Xe(t, e, n, s) {\\n        const i = new ir(t, xt.empty(), e, n);\\n        return s ? i.ke() : i;\\n    }\\n    je(t, e) {\\n        const n = new ur(e), s = null != e.collectionGroup ? e.collectionGroup : e.path.lastSegment();\\n        return this.getFieldIndexes(t, s).next((t => {\\n            // Return the index with the most number of segments.\\n            let e = null;\\n            for (const s of t) {\\n                n.$e(s) && (!e || s.fields.length > e.fields.length) && (e = s);\\n            }\\n            return e;\\n        }));\\n    }\\n    getIndexType(t, e) {\\n        let n = 2 /* FULL */;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? 0 /* NONE */ !== n && t.fields.length < function(t) {\\n                let e = new we(mt.comparator), n = !1;\\n                for (const s of t.filters) {\\n                    // TODO(orquery): Use the flattened filters here\\n                    const t = s;\\n                    // __name__ is not an explicit segment of any index, so we don't need to\\n                    // count it.\\n                                        t.field.isKeyField() || (\\n                    // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\\n                    // For instance, it is possible to have an index for \\\"a ARRAY a ASC\\\". Even\\n                    // though these are on the same field, they should be counted as two\\n                    // separate segments in an index.\\n                    \\\"array-contains\\\" /* ARRAY_CONTAINS */ === t.op || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === t.op ? n = !0 : e = e.add(t.field));\\n                }\\n                for (const n of t.orderBy) \\n                // __name__ is not an explicit segment of any index, so we don't need to\\n                // count it.\\n                n.field.isKeyField() || (e = e.add(n.field));\\n                return e.size + (n ? 1 : 0);\\n            }(e) && (n = 1 /* PARTIAL */) : n = 0 /* NONE */;\\n        })))).next((() => n));\\n    }\\n    /**\\n     * Returns the byte encoded form of the directional values in the field index.\\n     * Returns `null` if the document does not have all fields specified in the\\n     * index.\\n     */    Ze(t, e) {\\n        const n = new sr;\\n        for (const s of re(t)) {\\n            const t = e.data.field(s.fieldPath);\\n            if (null == t) return null;\\n            const i = n.Ne(s.kind);\\n            Yi.fe.Zt(t, i);\\n        }\\n        return n.Se();\\n    }\\n    /** Encodes a single value to the ascending index format. */    Je(t) {\\n        const e = new sr;\\n        return Yi.fe.Zt(t, e.Ne(0 /* ASCENDING */)), e.Se();\\n    }\\n    /**\\n     * Returns an encoded form of the document key that sorts based on the key\\n     * ordering of the field index.\\n     */    tn(t, e) {\\n        const n = new sr;\\n        return Yi.fe.Zt(qt(this.databaseId, e), n.Ne(function(t) {\\n            const e = re(t);\\n            return 0 === e.length ? 0 /* ASCENDING */ : e[e.length - 1].kind;\\n        }(t))), n.Se();\\n    }\\n    /**\\n     * Encodes the given field values according to the specification in `target`.\\n     * For IN queries, a list of possible values is returned.\\n     */    ze(t, e, n) {\\n        if (null === n) return [];\\n        let s = [];\\n        s.push(new sr);\\n        let i = 0;\\n        for (const r of re(t)) {\\n            const t = n[i++];\\n            for (const n of s) if (this.en(e, r.fieldPath) && Gt(t)) s = this.nn(s, r, t); else {\\n                const e = n.Ne(r.kind);\\n                Yi.fe.Zt(t, e);\\n            }\\n        }\\n        return this.sn(s);\\n    }\\n    /**\\n     * Encodes the given bounds according to the specification in `target`. For IN\\n     * queries, a list of possible values is returned.\\n     */    We(t, e, n) {\\n        return this.ze(t, e, n.position);\\n    }\\n    /** Returns the byte representation for the provided encoders. */    sn(t) {\\n        const e = [];\\n        for (let n = 0; n < t.length; ++n) e[n] = t[n].Se();\\n        return e;\\n    }\\n    /**\\n     * Creates a separate encoder for each element of an array.\\n     *\\n     * The method appends each value to all existing encoders (e.g. filter(\\\"a\\\",\\n     * \\\"==\\\", \\\"a1\\\").filter(\\\"b\\\", \\\"in\\\", [\\\"b1\\\", \\\"b2\\\"]) becomes [\\\"a1,b1\\\", \\\"a1,b2\\\"]). A\\n     * list of new encoders is returned.\\n     */    nn(t, e, n) {\\n        const s = [ ...t ], i = [];\\n        for (const t of n.arrayValue.values || []) for (const n of s) {\\n            const s = new sr;\\n            s.seed(n.Se()), Yi.fe.Zt(t, s.Ne(e.kind)), i.push(s);\\n        }\\n        return i;\\n    }\\n    en(t, e) {\\n        return !!t.filters.find((t => t instanceof Ve && t.field.isEqual(e) && (\\\"in\\\" /* IN */ === t.op || \\\"not-in\\\" /* NOT_IN */ === t.op)));\\n    }\\n    getFieldIndexes(t, e) {\\n        const n = _r(t), s = wr(t);\\n        return (e ? n.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)) : n.qt()).next((t => {\\n            const e = [];\\n            return yi.forEach(t, (t => s.get([ t.indexId, this.uid ]).next((n => {\\n                e.push(function(t, e) {\\n                    const n = e ? new ue(e.sequenceNumber, new he(Bi(e.readTime), new xt(Ws(e.documentKey)), e.largestBatchId)) : ue.empty(), s = t.fields.map((([t, e]) => new oe(mt.fromServerFormat(t), e)));\\n                    return new se(t.indexId, t.collectionGroup, s, n);\\n                }(t, n));\\n            })))).next((() => e));\\n        }));\\n    }\\n    getNextCollectionGroupToUpdate(t) {\\n        return this.getFieldIndexes(t).next((t => 0 === t.length ? null : (t.sort(((t, e) => {\\n            const n = t.indexState.sequenceNumber - e.indexState.sequenceNumber;\\n            return 0 !== n ? n : rt(t.collectionGroup, e.collectionGroup);\\n        })), t[0].collectionGroup)));\\n    }\\n    updateCollectionGroup(t, e, n) {\\n        const s = _r(t), i = wr(t);\\n        return this.rn(t).next((t => s.qt(\\\"collectionGroupIndex\\\", IDBKeyRange.bound(e, e)).next((e => yi.forEach(e, (e => i.put(function(t, e, n, s) {\\n            return {\\n                indexId: t,\\n                uid: e.uid || \\\"\\\",\\n                sequenceNumber: n,\\n                readTime: $i(s.readTime),\\n                documentKey: Gs(s.documentKey.path),\\n                largestBatchId: s.largestBatchId\\n            };\\n        }(e.indexId, this.user, t, n))))))));\\n    }\\n    updateIndexEntries(t, e) {\\n        // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\\n        // it could be used across different IndexedDB transactions. As any cached\\n        // data might be invalidated by other multi-tab clients, we can only trust\\n        // data within a single IndexedDB transaction. We therefore add a cache\\n        // here.\\n        const n = new Map;\\n        return yi.forEach(e, ((e, s) => {\\n            const i = n.get(e.collectionGroup);\\n            return (i ? yi.resolve(i) : this.getFieldIndexes(t, e.collectionGroup)).next((i => (n.set(e.collectionGroup, i), \\n            yi.forEach(i, (n => this.on(t, e, n).next((e => {\\n                const i = this.un(s, n);\\n                return e.isEqual(i) ? yi.resolve() : this.an(t, s, n, e, i);\\n            })))))));\\n        }));\\n    }\\n    cn(t, e, n, s) {\\n        return dr(t).put({\\n            indexId: s.indexId,\\n            uid: this.uid,\\n            arrayValue: s.arrayValue,\\n            directionalValue: s.directionalValue,\\n            orderedDocumentKey: this.tn(n, e.key),\\n            documentKey: e.key.path.toArray()\\n        });\\n    }\\n    hn(t, e, n, s) {\\n        return dr(t).delete([ s.indexId, this.uid, s.arrayValue, s.directionalValue, this.tn(n, e.key), e.key.path.toArray() ]);\\n    }\\n    on(t, e, n) {\\n        const s = dr(t);\\n        let i = new we(rr);\\n        return s.Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only([ n.indexId, this.uid, this.tn(n, e) ])\\n        }, ((t, s) => {\\n            i = i.add(new ir(n.indexId, e, s.arrayValue, s.directionalValue));\\n        })).next((() => i));\\n    }\\n    /** Creates the index entries for the given document. */    un(t, e) {\\n        let n = new we(rr);\\n        const s = this.Ze(e, t);\\n        if (null == s) return n;\\n        const i = ie(e);\\n        if (null != i) {\\n            const r = t.data.field(i.fieldPath);\\n            if (Gt(r)) for (const i of r.arrayValue.values || []) n = n.add(new ir(e.indexId, t.key, this.Je(i), s));\\n        } else n = n.add(new ir(e.indexId, t.key, hr, s));\\n        return n;\\n    }\\n    /**\\n     * Updates the index entries for the provided document by deleting entries\\n     * that are no longer referenced in `newEntries` and adding all newly added\\n     * entries.\\n     */    an(t, e, n, s, i) {\\n        O(\\\"IndexedDbIndexManager\\\", \\\"Updating index entries for document '%s'\\\", e.key);\\n        const r = [];\\n        return function(t, e, n, s, i) {\\n            const r = t.getIterator(), o = e.getIterator();\\n            let u = ge(r), a = ge(o);\\n            // Walk through the two sets at the same time, using the ordering defined by\\n            // `comparator`.\\n            for (;u || a; ) {\\n                let t = !1, e = !1;\\n                if (u && a) {\\n                    const s = n(u, a);\\n                    s < 0 ? \\n                    // The element was removed if the next element in our ordered\\n                    // walkthrough is only in `before`.\\n                    e = !0 : s > 0 && (\\n                    // The element was added if the next element in our ordered walkthrough\\n                    // is only in `after`.\\n                    t = !0);\\n                } else null != u ? e = !0 : t = !0;\\n                t ? (s(a), a = ge(o)) : e ? (i(u), u = ge(r)) : (u = ge(r), a = ge(o));\\n            }\\n        }(s, i, rr, (\\n        /* onAdd= */ s => {\\n            r.push(this.cn(t, e, n, s));\\n        }), (\\n        /* onRemove= */ s => {\\n            r.push(this.hn(t, e, n, s));\\n        })), yi.waitFor(r);\\n    }\\n    rn(t) {\\n        let e = 1;\\n        return wr(t).Wt({\\n            index: \\\"sequenceNumberIndex\\\",\\n            reverse: !0,\\n            range: IDBKeyRange.upperBound([ this.uid, Number.MAX_SAFE_INTEGER ])\\n        }, ((t, n, s) => {\\n            s.done(), e = n.sequenceNumber + 1;\\n        })).next((() => e));\\n    }\\n    /**\\n     * Returns a new set of IDB ranges that splits the existing range and excludes\\n     * any values that match the `notInValue` from these ranges. As an example,\\n     * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\\n     */    createRange(t, e, n) {\\n        // The notIn values need to be sorted and unique so that we can return a\\n        // sorted set of non-overlapping ranges.\\n        n = n.sort(((t, e) => rr(t, e))).filter(((t, e, n) => !e || 0 !== rr(t, n[e - 1])));\\n        const s = [];\\n        s.push(t);\\n        for (const i of n) {\\n            const n = rr(i, t), r = rr(i, e);\\n            if (0 === n) \\n            // `notInValue` is the lower bound. We therefore need to raise the bound\\n            // to the next value.\\n            s[0] = t.ke(); else if (n > 0 && r < 0) \\n            // `notInValue` is in the middle of the range\\n            s.push(i), s.push(i.ke()); else if (r > 0) \\n            // `notInValue` (and all following values) are out of the range\\n            break;\\n        }\\n        s.push(e);\\n        const i = [];\\n        for (let t = 0; t < s.length; t += 2) i.push(IDBKeyRange.bound([ s[t].indexId, this.uid, s[t].arrayValue, s[t].directionalValue, hr, [] ], [ s[t + 1].indexId, this.uid, s[t + 1].arrayValue, s[t + 1].directionalValue, hr, [] ]));\\n        return i;\\n    }\\n    getMinOffset(t, e) {\\n        let n;\\n        return yi.forEach(this.Qe(e), (e => this.je(t, e).next((t => {\\n            t ? (!n || le(t.indexState.offset, n) < 0) && (n = t.indexState.offset) : n = he.min();\\n        })))).next((() => n));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the collectionParents\\n * document store.\\n */ function fr(t) {\\n    return Si(t, \\\"collectionParents\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index entry object store.\\n */ function dr(t) {\\n    return Si(t, \\\"indexEntries\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index configuration object store.\\n */ function _r(t) {\\n    return Si(t, \\\"indexConfiguration\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the index state object store.\\n */ function wr(t) {\\n    return Si(t, \\\"indexState\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const mr = {\\n    didRun: !1,\\n    sequenceNumbersCollected: 0,\\n    targetsRemoved: 0,\\n    documentsRemoved: 0\\n};\\n\\nclass gr {\\n    constructor(\\n    // When we attempt to collect, we will only do so if the cache size is greater than this\\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\\n    t, \\n    // The percentage of sequence numbers that we will attempt to collect\\n    e, \\n    // A cap on the total number of sequence numbers that will be collected. This prevents\\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\\n    n) {\\n        this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n;\\n    }\\n    static withCacheSize(t) {\\n        return new gr(t, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Delete a mutation batch and the associated document mutations.\\n * @returns A PersistencePromise of the document mutations that were removed.\\n */\\nfunction yr(t, e, n) {\\n    const s = t.store(\\\"mutations\\\"), i = t.store(\\\"documentMutations\\\"), r = [], o = IDBKeyRange.only(n.batchId);\\n    let u = 0;\\n    const a = s.Wt({\\n        range: o\\n    }, ((t, e, n) => (u++, n.delete())));\\n    r.push(a.next((() => {\\n        U(1 === u);\\n    })));\\n    const c = [];\\n    for (const t of n.mutations) {\\n        const s = Js(e, t.key.path, n.batchId);\\n        r.push(i.delete(s)), c.push(t.key);\\n    }\\n    return yi.waitFor(r).next((() => c));\\n}\\n\\n/**\\n * Returns an approximate size for the given document.\\n */ function pr(t) {\\n    if (!t) return 0;\\n    let e;\\n    if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\\n        if (!t.noDocument) throw L();\\n        e = t.noDocument;\\n    }\\n    return JSON.stringify(e).length;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** A mutation queue for a specific user, backed by IndexedDB. */ gr.DEFAULT_COLLECTION_PERCENTILE = 10, \\ngr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, gr.DEFAULT = new gr(41943040, gr.DEFAULT_COLLECTION_PERCENTILE, gr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), \\ngr.DISABLED = new gr(-1, 0, 0);\\n\\nclass Ir {\\n    constructor(\\n    /**\\n     * The normalized userId (e.g. null UID => \\\"\\\" userId) used to store /\\n     * retrieve mutations.\\n     */\\n    t, e, n, s) {\\n        this.userId = t, this.M = e, this.indexManager = n, this.referenceDelegate = s, \\n        /**\\n         * Caches the document keys for pending mutation batches. If the mutation\\n         * has been removed from IndexedDb, the cached value may continue to\\n         * be used to retrieve the batch's document keys. To remove a cached value\\n         * locally, `removeCachedMutationKeys()` should be invoked either directly\\n         * or through `removeMutationBatches()`.\\n         *\\n         * With multi-tab, when the primary client acknowledges or rejects a mutation,\\n         * this cache is used by secondary clients to invalidate the local\\n         * view of the documents that were previously affected by the mutation.\\n         */\\n        // PORTING NOTE: Multi-tab only.\\n        this.ln = {};\\n    }\\n    /**\\n     * Creates a new mutation queue for the given user.\\n     * @param user - The user for which to create a mutation queue.\\n     * @param serializer - The serializer to use when persisting to IndexedDb.\\n     */    static Yt(t, e, n, s) {\\n        // TODO(mcg): Figure out what constraints there are on userIDs\\n        // In particular, are there any reserved characters? are empty ids allowed?\\n        // For the moment store these together in the same mutations table assuming\\n        // that empty userIDs aren't allowed.\\n        U(\\\"\\\" !== t.uid);\\n        const i = t.isAuthenticated() ? t.uid : \\\"\\\";\\n        return new Ir(i, e, n, s);\\n    }\\n    checkEmpty(t) {\\n        let e = !0;\\n        const n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: n\\n        }, ((t, n, s) => {\\n            e = !1, s.done();\\n        })).next((() => e));\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = Ar(t), r = Er(t);\\n        // The IndexedDb implementation in Chrome (and Firefox) does not handle\\n        // compound indices that include auto-generated keys correctly. To ensure\\n        // that the index entry is added correctly in all browsers, we perform two\\n        // writes: The first write is used to retrieve the next auto-generated Batch\\n        // ID, and the second write populates the index and stores the actual\\n        // mutation batch.\\n        // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\\n        // We write an empty object to obtain key\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return r.add({}).next((o => {\\n            U(\\\"number\\\" == typeof o);\\n            const u = new Di(o, e, n, s), a = function(t, e, n) {\\n                const s = n.baseMutations.map((e => vs(t.Jt, e))), i = n.mutations.map((e => vs(t.Jt, e)));\\n                return {\\n                    userId: e,\\n                    batchId: n.batchId,\\n                    localWriteTimeMs: n.localWriteTime.toMillis(),\\n                    baseMutations: s,\\n                    mutations: i\\n                };\\n            }(this.M, this.userId, u), c = [];\\n            let h = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n            for (const t of s) {\\n                const e = Js(this.userId, t.key.path, o);\\n                h = h.add(t.key.path.popLast()), c.push(r.put(a)), c.push(i.put(e, Ys));\\n            }\\n            return h.forEach((e => {\\n                c.push(this.indexManager.addToCollectionParentIndex(t, e));\\n            })), t.addOnCommittedListener((() => {\\n                this.ln[o] = u.keys();\\n            })), yi.waitFor(c).next((() => u));\\n        }));\\n    }\\n    lookupMutationBatch(t, e) {\\n        return Er(t).get(e).next((t => t ? (U(t.userId === this.userId), Li(this.M, t)) : null));\\n    }\\n    /**\\n     * Returns the document keys for the mutation batch with the given batchId.\\n     * For primary clients, this method returns `null` after\\n     * `removeMutationBatches()` has been called. Secondary clients return a\\n     * cached result until `removeCachedMutationKeys()` is invoked.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    fn(t, e) {\\n        return this.ln[e] ? yi.resolve(this.ln[e]) : this.lookupMutationBatch(t, e).next((t => {\\n            if (t) {\\n                const n = t.keys();\\n                return this.ln[e] = n, n;\\n            }\\n            return null;\\n        }));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = IDBKeyRange.lowerBound([ this.userId, n ]);\\n        let i = null;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: s\\n        }, ((t, e, s) => {\\n            e.userId === this.userId && (U(e.batchId >= n), i = Li(this.M, e)), s.done();\\n        })).next((() => i));\\n    }\\n    getHighestUnacknowledgedBatchId(t) {\\n        const e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]);\\n        let n = -1;\\n        return Er(t).Wt({\\n            index: \\\"userMutationsIndex\\\",\\n            range: e,\\n            reverse: !0\\n        }, ((t, e, s) => {\\n            n = e.batchId, s.done();\\n        })).next((() => n));\\n    }\\n    getAllMutationBatches(t) {\\n        const e = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);\\n        return Er(t).qt(\\\"userMutationsIndex\\\", e).next((t => t.map((t => Li(this.M, t)))));\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        // Scan the document-mutation index starting with a prefix starting with\\n        // the given documentKey.\\n        const n = Hs(this.userId, e.path), s = IDBKeyRange.lowerBound(n), i = [];\\n        return Ar(t).Wt({\\n            range: s\\n        }, ((n, s, r) => {\\n            const [o, u, a] = n, c = Ws(u);\\n            // Only consider rows matching exactly the specific key of\\n            // interest. Note that because we order by path first, and we\\n            // order terminators before path separators, we'll encounter all\\n            // the index rows for documentKey contiguously. In particular, all\\n            // the rows for documentKey will occur before any rows for\\n            // documents nested in a subcollection beneath documentKey so we\\n            // can stop as soon as we hit any such row.\\n                        if (o === this.userId && e.path.isEqual(c)) \\n            // Look up the mutation batch in the store.\\n            return Er(t).get(a).next((t => {\\n                if (!t) throw L();\\n                U(t.userId === this.userId), i.push(Li(this.M, t));\\n            }));\\n            r.done();\\n        })).next((() => i));\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        const s = [];\\n        return e.forEach((e => {\\n            const i = Hs(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ar(t).Wt({\\n                range: r\\n            }, ((t, s, i) => {\\n                const [r, o, u] = t, a = Ws(o);\\n                // Only consider rows matching exactly the specific key of\\n                // interest. Note that because we order by path first, and we\\n                // order terminators before path separators, we'll encounter all\\n                // the index rows for documentKey contiguously. In particular, all\\n                // the rows for documentKey will occur before any rows for\\n                // documents nested in a subcollection beneath documentKey so we\\n                // can stop as soon as we hit any such row.\\n                                r === this.userId && e.path.isEqual(a) ? n = n.add(u) : i.done();\\n            }));\\n            s.push(o);\\n        })), yi.waitFor(s).next((() => this.dn(t, n)));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        const n = e.path, s = n.length + 1, i = Hs(this.userId, n), r = IDBKeyRange.lowerBound(i);\\n        // Collect up unique batchIDs encountered during a scan of the index. Use a\\n        // SortedSet to accumulate batch IDs so they can be traversed in order in a\\n        // scan of the main table.\\n        let o = new we(rt);\\n        return Ar(t).Wt({\\n            range: r\\n        }, ((t, e, i) => {\\n            const [r, u, a] = t, c = Ws(u);\\n            r === this.userId && n.isPrefixOf(c) ? \\n            // Rows with document keys more than one segment longer than the\\n            // query path can't be matches. For example, a query on 'rooms'\\n            // can't match the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            c.length === s && (o = o.add(a)) : i.done();\\n        })).next((() => this.dn(t, o)));\\n    }\\n    dn(t, e) {\\n        const n = [], s = [];\\n        // TODO(rockwood): Implement this using iterate.\\n        return e.forEach((e => {\\n            s.push(Er(t).get(e).next((t => {\\n                if (null === t) throw L();\\n                U(t.userId === this.userId), n.push(Li(this.M, t));\\n            })));\\n        })), yi.waitFor(s).next((() => n));\\n    }\\n    removeMutationBatch(t, e) {\\n        return yr(t.Ht, this.userId, e).next((n => (t.addOnCommittedListener((() => {\\n            this._n(e.batchId);\\n        })), yi.forEach(n, (e => this.referenceDelegate.markPotentiallyOrphaned(t, e))))));\\n    }\\n    /**\\n     * Clears the cached keys for a mutation batch. This method should be\\n     * called by secondary clients after they process mutation updates.\\n     *\\n     * Note that this method does not have to be called from primary clients as\\n     * the corresponding cache entries are cleared when an acknowledged or\\n     * rejected batch is removed from the mutation queue.\\n     */\\n    // PORTING NOTE: Multi-tab only\\n    _n(t) {\\n        delete this.ln[t];\\n    }\\n    performConsistencyCheck(t) {\\n        return this.checkEmpty(t).next((e => {\\n            if (!e) return yi.resolve();\\n            // Verify that there are no entries in the documentMutations index if\\n            // the queue is empty.\\n                        const n = IDBKeyRange.lowerBound([ this.userId ]);\\n            const s = [];\\n            return Ar(t).Wt({\\n                range: n\\n            }, ((t, e, n) => {\\n                if (t[0] === this.userId) {\\n                    const e = Ws(t[1]);\\n                    s.push(e);\\n                } else n.done();\\n            })).next((() => {\\n                U(0 === s.length);\\n            }));\\n        }));\\n    }\\n    containsKey(t, e) {\\n        return Tr(t, this.userId, e);\\n    }\\n    // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\\n    /** Returns the mutation queue's metadata from IndexedDb. */\\n    wn(t) {\\n        return Rr(t).get(this.userId).next((t => t || {\\n            userId: this.userId,\\n            lastAcknowledgedBatchId: -1,\\n            lastStreamToken: \\\"\\\"\\n        }));\\n    }\\n}\\n\\n/**\\n * @returns true if the mutation queue for the given user contains a pending\\n *         mutation for the given key.\\n */ function Tr(t, e, n) {\\n    const s = Hs(e, n.path), i = s[1], r = IDBKeyRange.lowerBound(s);\\n    let o = !1;\\n    return Ar(t).Wt({\\n        range: r,\\n        jt: !0\\n    }, ((t, n, s) => {\\n        const [r, u, /*batchID*/ a] = t;\\n        r === e && u === i && (o = !0), s.done();\\n    })).next((() => o));\\n}\\n\\n/** Returns true if any mutation queue contains the given document. */\\n/**\\n * Helper to get a typed SimpleDbStore for the mutations object store.\\n */\\nfunction Er(t) {\\n    return Si(t, \\\"mutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Ar(t) {\\n    return Si(t, \\\"documentMutations\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\\n */ function Rr(t) {\\n    return Si(t, \\\"mutationQueues\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Offset to ensure non-overlapping target ids. */\\n/**\\n * Generates monotonically increasing target IDs for sending targets to the\\n * watch stream.\\n *\\n * The client constructs two generators, one for the target cache, and one for\\n * for the sync engine (to generate limbo documents targets). These\\n * generators produce non-overlapping IDs (by using even and odd IDs\\n * respectively).\\n *\\n * By separating the target ID space, the query cache can generate target IDs\\n * that persist across client restarts, while sync engine can independently\\n * generate in-memory target IDs that are transient and can be reused after a\\n * restart.\\n */\\nclass br {\\n    constructor(t) {\\n        this.mn = t;\\n    }\\n    next() {\\n        return this.mn += 2, this.mn;\\n    }\\n    static gn() {\\n        // The target cache generator must return '2' in its first call to `next()`\\n        // as there is no differentiation in the protocol layer between an unset\\n        // number and the number '0'. If we were to sent a target with target ID\\n        // '0', the backend would consider it unset and replace it with its own ID.\\n        return new br(0);\\n    }\\n    static yn() {\\n        // Sync engine assigns target IDs for limbo document detection.\\n        return new br(-1);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Pr {\\n    constructor(t, e) {\\n        this.referenceDelegate = t, this.M = e;\\n    }\\n    // PORTING NOTE: We don't cache global metadata for the target cache, since\\n    // some of it (in particular `highestTargetId`) can be modified by secondary\\n    // tabs. We could perhaps be more granular (and e.g. still cache\\n    // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\\n    // to IndexedDb whenever we need to read metadata. We can revisit if it turns\\n    // out to have a meaningful performance impact.\\n    allocateTargetId(t) {\\n        return this.pn(t).next((e => {\\n            const n = new br(e.highestTargetId);\\n            return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));\\n        }));\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return this.pn(t).next((t => ct.fromTimestamp(new at(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));\\n    }\\n    getHighestSequenceNumber(t) {\\n        return this.pn(t).next((t => t.highestListenSequenceNumber));\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return this.pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()), \\n        e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.In(t, s))));\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(t, e).next((() => this.pn(t).next((n => (n.targetCount += 1, this.En(e, n), \\n        this.In(t, n))))));\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(t, e);\\n    }\\n    removeTargetData(t, e) {\\n        return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => Vr(t).delete(e.targetId))).next((() => this.pn(t))).next((e => (U(e.targetCount > 0), \\n        e.targetCount -= 1, this.In(t, e))));\\n    }\\n    /**\\n     * Drops any targets with sequence number less than or equal to the upper bound, excepting those\\n     * present in `activeTargetIds`. Document associations for the removed targets are also removed.\\n     * Returns the number of targets removed.\\n     */    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return Vr(t).Wt(((r, o) => {\\n            const u = Ui(o);\\n            u.sequenceNumber <= e && null === n.get(u.targetId) && (s++, i.push(this.removeTargetData(t, u)));\\n        })).next((() => yi.waitFor(i))).next((() => s));\\n    }\\n    /**\\n     * Call provided function with each `TargetData` that we have cached.\\n     */    forEachTarget(t, e) {\\n        return Vr(t).Wt(((t, n) => {\\n            const s = Ui(n);\\n            e(s);\\n        }));\\n    }\\n    pn(t) {\\n        return vr(t).get(\\\"targetGlobalKey\\\").next((t => (U(null !== t), t)));\\n    }\\n    In(t, e) {\\n        return vr(t).put(\\\"targetGlobalKey\\\", e);\\n    }\\n    Tn(t, e) {\\n        return Vr(t).put(qi(this.M, e));\\n    }\\n    /**\\n     * In-place updates the provided metadata to account for values in the given\\n     * TargetData. Saving is done separately. Returns true if there were any\\n     * changes to the metadata.\\n     */    En(t, e) {\\n        let n = !1;\\n        return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), \\n        t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, \\n        n = !0), n;\\n    }\\n    getTargetCount(t) {\\n        return this.pn(t).next((t => t.targetCount));\\n    }\\n    getTargetData(t, e) {\\n        // Iterating by the canonicalId may yield more than one result because\\n        // canonicalId values are not required to be unique per target. This query\\n        // depends on the queryTargets index to be efficient.\\n        const n = Ie(e), s = IDBKeyRange.bound([ n, Number.NEGATIVE_INFINITY ], [ n, Number.POSITIVE_INFINITY ]);\\n        let i = null;\\n        return Vr(t).Wt({\\n            range: s,\\n            index: \\\"queryTargetsIndex\\\"\\n        }, ((t, n, s) => {\\n            const r = Ui(n);\\n            // After finding a potential match, check that the target is\\n            // actually equal to the requested target.\\n                        Ee(e, r.target) && (i = r, s.done());\\n        })).next((() => i));\\n    }\\n    addMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = [], i = Sr(t);\\n        return e.forEach((e => {\\n            const r = Gs(e.path);\\n            s.push(i.put({\\n                targetId: n,\\n                path: r\\n            })), s.push(this.referenceDelegate.addReference(t, n, e));\\n        })), yi.waitFor(s);\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        // PORTING NOTE: The reverse index (documentsTargets) is maintained by\\n        // IndexedDb.\\n        const s = Sr(t);\\n        return yi.forEach(e, (e => {\\n            const i = Gs(e.path);\\n            return yi.waitFor([ s.delete([ n, i ]), this.referenceDelegate.removeReference(t, n, e) ]);\\n        }));\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        const n = Sr(t), s = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        return n.delete(s);\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = IDBKeyRange.bound([ e ], [ e + 1 ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0), s = Sr(t);\\n        let i = Yn();\\n        return s.Wt({\\n            range: n,\\n            jt: !0\\n        }, ((t, e, n) => {\\n            const s = Ws(t[1]), r = new xt(s);\\n            i = i.add(r);\\n        })).next((() => i));\\n    }\\n    containsKey(t, e) {\\n        const n = Gs(e.path), s = IDBKeyRange.bound([ n ], [ ut(n) ], \\n        /*lowerOpen=*/ !1, \\n        /*upperOpen=*/ !0);\\n        let i = 0;\\n        return Sr(t).Wt({\\n            index: \\\"documentTargetsIndex\\\",\\n            jt: !0,\\n            range: s\\n        }, (([t, e], n, s) => {\\n            // Having a sentinel row for a document does not count as containing that document;\\n            // For the target cache, containing the document means the document is part of some\\n            // target.\\n            0 !== t && (i++, s.done());\\n        })).next((() => i > 0));\\n    }\\n    /**\\n     * Looks up a TargetData entry by target ID.\\n     *\\n     * @param targetId - The target ID of the TargetData entry to look up.\\n     * @returns The cached TargetData entry, or null if the cache has no entry for\\n     * the target.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    Et(t, e) {\\n        return Vr(t).get(e).next((t => t ? Ui(t) : null));\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the queries object store.\\n */ function Vr(t) {\\n    return Si(t, \\\"targets\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the target globals object store.\\n */ function vr(t) {\\n    return Si(t, \\\"targetGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the document target object store.\\n */ function Sr(t) {\\n    return Si(t, \\\"targetDocuments\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\\n * operation fails because the primary lease has been taken by another client,\\n * we ignore the error (the persistence layer will immediately call\\n * `applyPrimaryLease` to propagate the primary state change). All other errors\\n * are re-thrown.\\n *\\n * @param err - An error returned by a LocalStore operation.\\n * @returns A Promise that resolves after we recovered, or the original error.\\n */ async function Dr(t) {\\n    if (t.code !== G.FAILED_PRECONDITION || t.message !== mi) throw t;\\n    O(\\\"LocalStore\\\", \\\"Unexpectedly lost primary lease\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Cr([t, e], [n, s]) {\\n    const i = rt(t, n);\\n    return 0 === i ? rt(e, s) : i;\\n}\\n\\n/**\\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\\n * lowest n values passed to `addElement`, and finally reports the largest of\\n * them in `maxValue`.\\n */ class xr {\\n    constructor(t) {\\n        this.An = t, this.buffer = new we(Cr), this.Rn = 0;\\n    }\\n    bn() {\\n        return ++this.Rn;\\n    }\\n    Pn(t) {\\n        const e = [ t, this.bn() ];\\n        if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {\\n            const t = this.buffer.last();\\n            Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));\\n        }\\n    }\\n    get maxValue() {\\n        // Guaranteed to be non-empty. If we decide we are not collecting any\\n        // sequence numbers, nthSequenceNumber below short-circuits. If we have\\n        // decided that we are collecting n sequence numbers, it's because n is some\\n        // percentage of the existing sequence numbers. That means we should never\\n        // be in a situation where we are collecting sequence numbers but don't\\n        // actually have any.\\n        return this.buffer.last()[0];\\n    }\\n}\\n\\n/**\\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\\n * whether or not GC is enabled, as well as which delay to use before the next run.\\n */ class Nr {\\n    constructor(t, e) {\\n        this.garbageCollector = t, this.asyncQueue = e, this.Vn = !1, this.vn = null;\\n    }\\n    start(t) {\\n        -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.Sn(t);\\n    }\\n    stop() {\\n        this.vn && (this.vn.cancel(), this.vn = null);\\n    }\\n    get started() {\\n        return null !== this.vn;\\n    }\\n    Sn(t) {\\n        const e = this.Vn ? 3e5 : 6e4;\\n        O(\\\"LruGarbageCollector\\\", `Garbage collection scheduled in ${e}ms`), this.vn = this.asyncQueue.enqueueAfterDelay(\\\"lru_garbage_collection\\\" /* LruGarbageCollection */ , e, (async () => {\\n            this.vn = null, this.Vn = !0;\\n            try {\\n                await t.collectGarbage(this.garbageCollector);\\n            } catch (t) {\\n                Ai(t) ? O(\\\"LruGarbageCollector\\\", \\\"Ignoring IndexedDB error during garbage collection: \\\", t) : await Dr(t);\\n            }\\n            await this.Sn(t);\\n        }));\\n    }\\n}\\n\\n/** Implements the steps for LRU garbage collection. */ class kr {\\n    constructor(t, e) {\\n        this.Dn = t, this.params = e;\\n    }\\n    calculateTargetCount(t, e) {\\n        return this.Dn.Cn(t).next((t => Math.floor(e / 100 * t)));\\n    }\\n    nthSequenceNumber(t, e) {\\n        if (0 === e) return yi.resolve(nt.A);\\n        const n = new xr(e);\\n        return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));\\n    }\\n    removeTargets(t, e, n) {\\n        return this.Dn.removeTargets(t, e, n);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        return this.Dn.removeOrphanedDocuments(t, e);\\n    }\\n    collect(t, e) {\\n        return -1 === this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", \\\"Garbage collection skipped; disabled\\\"), \\n        yi.resolve(mr)) : this.getCacheSize(t).next((n => n < this.params.cacheSizeCollectionThreshold ? (O(\\\"LruGarbageCollector\\\", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`), \\n        mr) : this.Nn(t, e)));\\n    }\\n    getCacheSize(t) {\\n        return this.Dn.getCacheSize(t);\\n    }\\n    Nn(t, e) {\\n        let n, s, i, r, o, a, c;\\n        const h = Date.now();\\n        return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (\\n        // Cap at the configured max\\n        e > this.params.maximumSequenceNumbersToCollect ? (O(\\\"LruGarbageCollector\\\", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`), \\n        s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s, \\n        o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(), \\n        this.removeOrphanedDocuments(t, n)))).next((t => {\\n            if (c = Date.now(), k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG) {\\n                O(\\\"LruGarbageCollector\\\", `LRU Garbage Collection\\\\n\\\\tCounted targets in ${r - h}ms\\\\n\\\\tDetermined least recently used ${s} in ` + (o - r) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${i} targets in ` + (a - o) + \\\"ms\\\\n\\\" + `\\\\tRemoved ${t} documents in ` + (c - a) + \\\"ms\\\\n\\\" + `Total Duration: ${c - h}ms`);\\n            }\\n            return yi.resolve({\\n                didRun: !0,\\n                sequenceNumbersCollected: s,\\n                targetsRemoved: i,\\n                documentsRemoved: t\\n            });\\n        }));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Provides LRU functionality for IndexedDB persistence. */\\nclass Mr {\\n    constructor(t, e) {\\n        this.db = t, this.garbageCollector = function(t, e) {\\n            return new kr(t, e);\\n        }(this, e);\\n    }\\n    Cn(t) {\\n        const e = this.kn(t);\\n        return this.db.getTargetCache().getTargetCount(t).next((t => e.next((e => t + e))));\\n    }\\n    kn(t) {\\n        let e = 0;\\n        return this.xn(t, (t => {\\n            e++;\\n        })).next((() => e));\\n    }\\n    forEachTarget(t, e) {\\n        return this.db.getTargetCache().forEachTarget(t, e);\\n    }\\n    xn(t, e) {\\n        return this.Mn(t, ((t, n) => e(n)));\\n    }\\n    addReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeReference(t, e, n) {\\n        return Or(t, n);\\n    }\\n    removeTargets(t, e, n) {\\n        return this.db.getTargetCache().removeTargets(t, e, n);\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Returns true if anything would prevent this document from being garbage\\n     * collected, given that the document in question is not present in any\\n     * targets and has a sequence number less than or equal to the upper bound for\\n     * the collection run.\\n     */    On(t, e) {\\n        return function(t, e) {\\n            let n = !1;\\n            return Rr(t).zt((s => Tr(t, s, e).next((t => (t && (n = !0), yi.resolve(!t)))))).next((() => n));\\n        }(t, e);\\n    }\\n    removeOrphanedDocuments(t, e) {\\n        const n = this.db.getRemoteDocumentCache().newChangeBuffer(), s = [];\\n        let i = 0;\\n        return this.Mn(t, ((r, o) => {\\n            if (o <= e) {\\n                const e = this.On(t, r).next((e => {\\n                    if (!e) \\n                    // Our size accounting requires us to read all documents before\\n                    // removing them.\\n                    return i++, n.getEntry(t, r).next((() => (n.removeEntry(r, ct.min()), Sr(t).delete([ 0, Gs(r.path) ]))));\\n                }));\\n                s.push(e);\\n            }\\n        })).next((() => yi.waitFor(s))).next((() => n.apply(t))).next((() => i));\\n    }\\n    removeTarget(t, e) {\\n        const n = e.withSequenceNumber(t.currentSequenceNumber);\\n        return this.db.getTargetCache().updateTargetData(t, n);\\n    }\\n    updateLimboDocument(t, e) {\\n        return Or(t, e);\\n    }\\n    /**\\n     * Call provided function for each document in the cache that is 'orphaned'. Orphaned\\n     * means not a part of any target, so the only entry in the target-document index for\\n     * that document will be the sentinel row (targetId 0), which will also have the sequence\\n     * number for the last time the document was accessed.\\n     */    Mn(t, e) {\\n        const n = Sr(t);\\n        let s, i = nt.A;\\n        return n.Wt({\\n            index: \\\"documentTargetsIndex\\\"\\n        }, (([t, n], {path: r, sequenceNumber: o}) => {\\n            0 === t ? (\\n            // if nextToReport is valid, report it, this is a new key so the\\n            // last one must not be a member of any targets.\\n            i !== nt.A && e(new xt(Ws(s)), i), \\n            // set nextToReport to be this sequence number. It's the next one we\\n            // might report, if we don't find any targets for this document.\\n            // Note that the sequence number must be defined when the targetId\\n            // is 0.\\n            i = o, s = r) : \\n            // set nextToReport to be invalid, we know we don't need to report\\n            // this one since we found a target for it.\\n            i = nt.A;\\n        })).next((() => {\\n            // Since we report sequence numbers after getting to the next key, we\\n            // need to check if the last key we iterated over was an orphaned\\n            // document and report it.\\n            i !== nt.A && e(new xt(Ws(s)), i);\\n        }));\\n    }\\n    getCacheSize(t) {\\n        return this.db.getRemoteDocumentCache().getSize(t);\\n    }\\n}\\n\\nfunction Or(t, e) {\\n    return Sr(t).put(\\n    /**\\n * @returns A value suitable for writing a sentinel row in the target-document\\n * store.\\n */\\n    function(t, e) {\\n        return {\\n            targetId: 0,\\n            path: Gs(t.path),\\n            sequenceNumber: e\\n        };\\n    }(e, t.currentSequenceNumber));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\\n * It can be used to batch up a set of changes to be written to the cache, but\\n * additionally supports reading entries back with the `getEntry()` method,\\n * falling back to the underlying RemoteDocumentCache if no entry is\\n * buffered.\\n *\\n * Entries added to the cache *must* be read first. This is to facilitate\\n * calculating the size delta of the pending changes.\\n *\\n * PORTING NOTE: This class was implemented then removed from other platforms.\\n * If byte-counting ends up being needed on the other platforms, consider\\n * porting this class as part of that implementation work.\\n */ class Fr {\\n    constructor() {\\n        // A mapping of document key to the new cache entry that should be written.\\n        this.changes = new Kn((t => t.toString()), ((t, e) => t.isEqual(e))), this.changesApplied = !1;\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.addEntry()` call.\\n     *\\n     * You can only modify documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    addEntry(t) {\\n        this.assertNotApplied(), this.changes.set(t.key, t);\\n    }\\n    /**\\n     * Buffers a `RemoteDocumentCache.removeEntry()` call.\\n     *\\n     * You can only remove documents that have already been retrieved via\\n     * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\\n     */    removeEntry(t, e) {\\n        this.assertNotApplied(), this.changes.set(t, ne.newInvalidDocument(t).setReadTime(e));\\n    }\\n    /**\\n     * Looks up an entry in the cache. The buffered changes will first be checked,\\n     * and if no buffered change applies, this will forward to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document or an invalid document if we have nothing\\n     * cached.\\n     */    getEntry(t, e) {\\n        this.assertNotApplied();\\n        const n = this.changes.get(e);\\n        return void 0 !== n ? yi.resolve(n) : this.getFromCache(t, e);\\n    }\\n    /**\\n     * Looks up several entries in the cache, forwarding to\\n     * `RemoteDocumentCache.getEntry()`.\\n     *\\n     * @param transaction - The transaction in which to perform any persistence\\n     *     operations.\\n     * @param documentKeys - The keys of the entries to look up.\\n     * @returns A map of cached documents, indexed by key. If an entry cannot be\\n     *     found, the corresponding key will be mapped to an invalid document.\\n     */    getEntries(t, e) {\\n        return this.getAllFromCache(t, e);\\n    }\\n    /**\\n     * Applies buffered changes to the underlying RemoteDocumentCache, using\\n     * the provided transaction.\\n     */    apply(t) {\\n        return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t);\\n    }\\n    /** Helper to assert this.changes is not null  */    assertNotApplied() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newIndexedDbRemoteDocumentCache()`.\\n */ class $r {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entries to the cache.\\n     *\\n     * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    addEntry(t, e, n) {\\n        return Ur(t).put(n);\\n    }\\n    /**\\n     * Removes a document from the cache.\\n     *\\n     * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\\n     */    removeEntry(t, e, n) {\\n        return Ur(t).delete(\\n        /**\\n * Returns a key that can be used for document lookups via the primary key of\\n * the DbRemoteDocument object store.\\n */\\n        function(t, e) {\\n            const n = t.path.toArray();\\n            return [ \\n            /* prefix path */ n.slice(0, n.length - 2), \\n            /* collection id */ n[n.length - 2], Fi(e), \\n            /* document id */ n[n.length - 1] ];\\n        }\\n        /**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\\n */ (e, n));\\n    }\\n    /**\\n     * Updates the current cache size.\\n     *\\n     * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\\n     * cache's metadata.\\n     */    updateMetadata(t, e) {\\n        return this.getMetadata(t).next((n => (n.byteSize += e, this.Fn(t, n))));\\n    }\\n    getEntry(t, e) {\\n        let n = ne.newInvalidDocument(e);\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = this.$n(e, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up an entry in the cache.\\n     *\\n     * @param documentKey - The key of the entry to look up.\\n     * @returns The cached document entry and its size.\\n     */    Bn(t, e) {\\n        let n = {\\n            size: 0,\\n            document: ne.newInvalidDocument(e)\\n        };\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: IDBKeyRange.only(qr(e))\\n        }, ((t, s) => {\\n            n = {\\n                document: this.$n(e, s),\\n                size: pr(s)\\n            };\\n        })).next((() => n));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return this.Ln(t, e, ((t, e) => {\\n            const s = this.$n(t, e);\\n            n = n.insert(t, s);\\n        })).next((() => n));\\n    }\\n    /**\\n     * Looks up several entries in the cache.\\n     *\\n     * @param documentKeys - The set of keys entries to look up.\\n     * @returns A map of documents indexed by key and a map of sizes indexed by\\n     *     key (zero if the document does not exist).\\n     */    Un(t, e) {\\n        let n = Qn(), s = new fe(xt.comparator);\\n        return this.Ln(t, e, ((t, e) => {\\n            const i = this.$n(t, e);\\n            n = n.insert(t, i), s = s.insert(t, pr(e));\\n        })).next((() => ({\\n            documents: n,\\n            qn: s\\n        })));\\n    }\\n    Ln(t, e, n) {\\n        if (e.isEmpty()) return yi.resolve();\\n        let s = new we(Gr);\\n        e.forEach((t => s = s.add(t)));\\n        const i = IDBKeyRange.bound(qr(s.first()), qr(s.last())), r = s.getIterator();\\n        let o = r.getNext();\\n        return Ur(t).Wt({\\n            index: \\\"documentKeyIndex\\\",\\n            range: i\\n        }, ((t, e, s) => {\\n            const i = xt.fromSegments([ ...e.prefixPath, e.collectionGroup, e.documentId ]);\\n            // Go through keys not found in cache.\\n                        for (;o && Gr(o, i) < 0; ) n(o, null), o = r.getNext();\\n            o && o.isEqual(i) && (\\n            // Key found in cache.\\n            n(o, e), o = r.hasNext() ? r.getNext() : null), \\n            // Skip to the next key (if there is one).\\n            o ? s.Ut(qr(o)) : s.done();\\n        })).next((() => {\\n            // The rest of the keys are not in the cache. One case where `iterate`\\n            // above won't go through them is when the cache is empty.\\n            for (;o; ) n(o, null), o = r.hasNext() ? r.getNext() : null;\\n        }));\\n    }\\n    getAllFromCollection(t, e, n) {\\n        const s = [ e.popLast().toArray(), e.lastSegment(), Fi(n.readTime), n.documentKey.path.isEmpty() ? \\\"\\\" : n.documentKey.path.lastSegment() ], i = [ e.popLast().toArray(), e.lastSegment(), [ Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER ], \\\"\\\" ];\\n        return Ur(t).qt(IDBKeyRange.bound(s, i, !0)).next((t => {\\n            let e = Qn();\\n            for (const n of t) {\\n                const t = this.$n(xt.fromSegments(n.prefixPath.concat(n.collectionGroup, n.documentId)), n);\\n                e = e.insert(t.key, t);\\n            }\\n            return e;\\n        }));\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        let i = Qn();\\n        const r = Kr(e, n), o = Kr(e, he.max());\\n        return Ur(t).Wt({\\n            index: \\\"collectionGroupIndex\\\",\\n            range: IDBKeyRange.bound(r, o, !0)\\n        }, ((t, e, n) => {\\n            const r = this.$n(xt.fromSegments(e.prefixPath.concat(e.collectionGroup, e.documentId)), e);\\n            i = i.insert(r.key, r), i.size === s && n.done();\\n        })).next((() => i));\\n    }\\n    newChangeBuffer(t) {\\n        return new Br(this, !!t && t.trackRemovals);\\n    }\\n    getSize(t) {\\n        return this.getMetadata(t).next((t => t.byteSize));\\n    }\\n    getMetadata(t) {\\n        return Lr(t).get(\\\"remoteDocumentGlobalKey\\\").next((t => (U(!!t), t)));\\n    }\\n    Fn(t, e) {\\n        return Lr(t).put(\\\"remoteDocumentGlobalKey\\\", e);\\n    }\\n    /**\\n     * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\\n     * the document corresponds to the format used for sentinel deletes).\\n     */    $n(t, e) {\\n        if (e) {\\n            const t = Mi(this.M, e);\\n            // Whether the document is a sentinel removal and should only be used in the\\n            // `getNewDocumentChanges()`\\n                        if (!(t.isNoDocument() && t.version.isEqual(ct.min()))) return t;\\n        }\\n        return ne.newInvalidDocument(t);\\n    }\\n}\\n\\n/** Creates a new IndexedDbRemoteDocumentCache. */\\n/**\\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\\n *\\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\\n * when we apply the changes.\\n */\\nclass Br extends Fr {\\n    /**\\n     * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\\n     * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\\n     * `getNewDocumentChanges()`.\\n     */\\n    constructor(t, e) {\\n        super(), this.Kn = t, this.trackRemovals = e, \\n        // A map of document sizes and read times prior to applying the changes in\\n        // this buffer.\\n        this.Gn = new Kn((t => t.toString()), ((t, e) => t.isEqual(e)));\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        let n = 0, s = new we(((t, e) => rt(t.canonicalString(), e.canonicalString())));\\n        return this.changes.forEach(((i, r) => {\\n            const o = this.Gn.get(i);\\n            if (e.push(this.Kn.removeEntry(t, i, o.readTime)), r.isValidDocument()) {\\n                const u = Oi(this.Kn.M, r);\\n                s = s.add(i.path.popLast());\\n                const a = pr(u);\\n                n += a - o.size, e.push(this.Kn.addEntry(t, i, u));\\n            } else if (n -= o.size, this.trackRemovals) {\\n                // In order to track removals, we store a \\\"sentinel delete\\\" in the\\n                // RemoteDocumentCache. This entry is represented by a NoDocument\\n                // with a version of 0 and ignored by `maybeDecodeDocument()` but\\n                // preserved in `getNewDocumentChanges()`.\\n                const n = Oi(this.Kn.M, r.convertToNoDocument(ct.min()));\\n                e.push(this.Kn.addEntry(t, i, n));\\n            }\\n        })), s.forEach((n => {\\n            e.push(this.Kn.indexManager.addToCollectionParentIndex(t, n));\\n        })), e.push(this.Kn.updateMetadata(t, n)), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute a delta later.\\n        return this.Kn.Bn(t, e).next((t => (this.Gn.set(e, {\\n            size: t.size,\\n            readTime: t.document.readTime\\n        }), t.document)));\\n    }\\n    getAllFromCache(t, e) {\\n        // Record the size of everything we load from the cache so we can compute\\n        // a delta later.\\n        return this.Kn.Un(t, e).next((({documents: t, qn: e}) => (\\n        // Note: `getAllFromCache` returns two maps instead of a single map from\\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\\n        // `MutableDocumentMap` directly, without a conversion.\\n        e.forEach(((e, n) => {\\n            this.Gn.set(e, {\\n                size: n,\\n                readTime: t.get(e).readTime\\n            });\\n        })), t)));\\n    }\\n}\\n\\nfunction Lr(t) {\\n    return Si(t, \\\"remoteDocumentGlobal\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\\n */ function Ur(t) {\\n    return Si(t, \\\"remoteDocumentsV14\\\");\\n}\\n\\n/**\\n * Returns a key that can be used for document lookups on the\\n * `DbRemoteDocumentDocumentKeyIndex` index.\\n */ function qr(t) {\\n    const e = t.path.toArray();\\n    return [ \\n    /* prefix path */ e.slice(0, e.length - 2), \\n    /* collection id */ e[e.length - 2], \\n    /* document id */ e[e.length - 1] ];\\n}\\n\\nfunction Kr(t, e) {\\n    const n = e.documentKey.path.toArray();\\n    return [ \\n    /* collection id */ t, Fi(e.readTime), \\n    /* prefix path */ n.slice(0, n.length - 2), \\n    /* document id */ n.length > 0 ? n[n.length - 1] : \\\"\\\" ];\\n}\\n\\n/**\\n * Comparator that compares document keys according to the primary key sorting\\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\\n * and then document ID).\\n *\\n * Visible for testing.\\n */ function Gr(t, e) {\\n    const n = t.path.toArray(), s = e.path.toArray();\\n    // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\\n    let i = 0;\\n    for (let t = 0; t < n.length - 2 && t < s.length - 2; ++t) if (i = rt(n[t], s[t]), \\n    i) return i;\\n    return i = rt(n.length, s.length), i || (i = rt(n[n.length - 2], s[s.length - 2]), \\n    i || rt(n[n.length - 1], s[s.length - 1]));\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(indexing): Remove this constant\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Performs database creation and schema upgrades. */\\nclass Qr {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    /**\\n     * Performs database creation and schema upgrades.\\n     *\\n     * Note that in production, this method is only ever used to upgrade the schema\\n     * to SCHEMA_VERSION. Different values of toVersion are only used for testing\\n     * and local feature development.\\n     */    kt(t, e, n, s) {\\n        const i = new pi(\\\"createOrUpgrade\\\", e);\\n        n < 1 && s >= 1 && (function(t) {\\n            t.createObjectStore(\\\"owner\\\");\\n        }(t), function(t) {\\n            t.createObjectStore(\\\"mutationQueues\\\", {\\n                keyPath: \\\"userId\\\"\\n            });\\n            t.createObjectStore(\\\"mutations\\\", {\\n                keyPath: \\\"batchId\\\",\\n                autoIncrement: !0\\n            }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                unique: !0\\n            }), t.createObjectStore(\\\"documentMutations\\\");\\n        }\\n        /**\\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\\n * and rewrites all data.\\n */ (t), jr(t), function(t) {\\n            t.createObjectStore(\\\"remoteDocuments\\\");\\n        }(t));\\n        // Migration 2 to populate the targetGlobal object no longer needed since\\n        // migration 3 unconditionally clears it.\\n                let r = yi.resolve();\\n        return n < 3 && s >= 3 && (\\n        // Brand new clients don't need to drop and recreate--only clients that\\n        // potentially have corrupt data.\\n        0 !== n && (!function(t) {\\n            t.deleteObjectStore(\\\"targetDocuments\\\"), t.deleteObjectStore(\\\"targets\\\"), t.deleteObjectStore(\\\"targetGlobal\\\");\\n        }(t), jr(t)), r = r.next((() => \\n        /**\\n * Creates the target global singleton row.\\n *\\n * @param txn - The version upgrade transaction for indexeddb\\n */\\n        function(t) {\\n            const e = t.store(\\\"targetGlobal\\\"), n = {\\n                highestTargetId: 0,\\n                highestListenSequenceNumber: 0,\\n                lastRemoteSnapshotVersion: ct.min().toTimestamp(),\\n                targetCount: 0\\n            };\\n            return e.put(\\\"targetGlobalKey\\\", n);\\n        }(i)))), n < 4 && s >= 4 && (0 !== n && (\\n        // Schema version 3 uses auto-generated keys to generate globally unique\\n        // mutation batch IDs (this was previously ensured internally by the\\n        // client). To migrate to the new schema, we have to read all mutations\\n        // and write them back out. We preserve the existing batch IDs to guarantee\\n        // consistency with other object stores. Any further mutation batch IDs will\\n        // be auto-generated.\\n        r = r.next((() => function(t, e) {\\n            return e.store(\\\"mutations\\\").qt().next((n => {\\n                t.deleteObjectStore(\\\"mutations\\\");\\n                t.createObjectStore(\\\"mutations\\\", {\\n                    keyPath: \\\"batchId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"userMutationsIndex\\\", zs, {\\n                    unique: !0\\n                });\\n                const s = e.store(\\\"mutations\\\"), i = n.map((t => s.put(t)));\\n                return yi.waitFor(i);\\n            }));\\n        }(t, i)))), r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"clientMetadata\\\", {\\n                    keyPath: \\\"clientId\\\"\\n                });\\n            }(t);\\n        }))), n < 5 && s >= 5 && (r = r.next((() => this.Qn(i)))), n < 6 && s >= 6 && (r = r.next((() => (function(t) {\\n            t.createObjectStore(\\\"remoteDocumentGlobal\\\");\\n        }(t), this.jn(i))))), n < 7 && s >= 7 && (r = r.next((() => this.Wn(i)))), n < 8 && s >= 8 && (r = r.next((() => this.zn(t, i)))), \\n        n < 9 && s >= 9 && (r = r.next((() => {\\n            // Multi-Tab used to manage its own changelog, but this has been moved\\n            // to the DbRemoteDocument object store itself. Since the previous change\\n            // log only contained transient data, we can drop its object store.\\n            !function(t) {\\n                t.objectStoreNames.contains(\\\"remoteDocumentChanges\\\") && t.deleteObjectStore(\\\"remoteDocumentChanges\\\");\\n            }(t);\\n            // Note: Schema version 9 used to create a read time index for the\\n            // RemoteDocumentCache. This is now done with schema version 13.\\n                }))), n < 10 && s >= 10 && (r = r.next((() => this.Hn(i)))), n < 11 && s >= 11 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"bundles\\\", {\\n                    keyPath: \\\"bundleId\\\"\\n                });\\n            }(t), function(t) {\\n                t.createObjectStore(\\\"namedQueries\\\", {\\n                    keyPath: \\\"name\\\"\\n                });\\n            }(t);\\n        }))), n < 12 && s >= 12 && (r = r.next((() => {\\n            !function(t) {\\n                const e = t.createObjectStore(\\\"documentOverlays\\\", {\\n                    keyPath: ci\\n                });\\n                e.createIndex(\\\"collectionPathOverlayIndex\\\", hi, {\\n                    unique: !1\\n                }), e.createIndex(\\\"collectionGroupOverlayIndex\\\", li, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), n < 13 && s >= 13 && (r = r.next((() => function(t) {\\n            const e = t.createObjectStore(\\\"remoteDocumentsV14\\\", {\\n                keyPath: Xs\\n            });\\n            e.createIndex(\\\"documentKeyIndex\\\", Zs), e.createIndex(\\\"collectionGroupIndex\\\", ti);\\n        }(t))).next((() => this.Jn(t, i))).next((() => t.deleteObjectStore(\\\"remoteDocuments\\\")))), \\n        n < 14 && s >= 14 && (r = r.next((() => {\\n            !function(t) {\\n                t.createObjectStore(\\\"indexConfiguration\\\", {\\n                    keyPath: \\\"indexId\\\",\\n                    autoIncrement: !0\\n                }).createIndex(\\\"collectionGroupIndex\\\", \\\"collectionGroup\\\", {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexState\\\", {\\n                    keyPath: ri\\n                }).createIndex(\\\"sequenceNumberIndex\\\", oi, {\\n                    unique: !1\\n                });\\n                t.createObjectStore(\\\"indexEntries\\\", {\\n                    keyPath: ui\\n                }).createIndex(\\\"documentKeyIndex\\\", ai, {\\n                    unique: !1\\n                });\\n            }(t);\\n        }))), r;\\n    }\\n    jn(t) {\\n        let e = 0;\\n        return t.store(\\\"remoteDocuments\\\").Wt(((t, n) => {\\n            e += pr(n);\\n        })).next((() => {\\n            const n = {\\n                byteSize: e\\n            };\\n            return t.store(\\\"remoteDocumentGlobal\\\").put(\\\"remoteDocumentGlobalKey\\\", n);\\n        }));\\n    }\\n    Qn(t) {\\n        const e = t.store(\\\"mutationQueues\\\"), n = t.store(\\\"mutations\\\");\\n        return e.qt().next((e => yi.forEach(e, (e => {\\n            const s = IDBKeyRange.bound([ e.userId, -1 ], [ e.userId, e.lastAcknowledgedBatchId ]);\\n            return n.qt(\\\"userMutationsIndex\\\", s).next((n => yi.forEach(n, (n => {\\n                U(n.userId === e.userId);\\n                const s = Li(this.M, n);\\n                return yr(t, e.userId, s).next((() => {}));\\n            }))));\\n        }))));\\n    }\\n    /**\\n     * Ensures that every document in the remote document cache has a corresponding sentinel row\\n     * with a sequence number. Missing rows are given the most recently used sequence number.\\n     */    Wn(t) {\\n        const e = t.store(\\\"targetDocuments\\\"), n = t.store(\\\"remoteDocuments\\\");\\n        return t.store(\\\"targetGlobal\\\").get(\\\"targetGlobalKey\\\").next((t => {\\n            const s = [];\\n            return n.Wt(((n, i) => {\\n                const r = new _t(n), o = function(t) {\\n                    return [ 0, Gs(t) ];\\n                }(r);\\n                s.push(e.get(o).next((n => n ? yi.resolve() : (n => e.put({\\n                    targetId: 0,\\n                    path: Gs(n),\\n                    sequenceNumber: t.highestListenSequenceNumber\\n                }))(r))));\\n            })).next((() => yi.waitFor(s)));\\n        }));\\n    }\\n    zn(t, e) {\\n        // Create the index.\\n        t.createObjectStore(\\\"collectionParents\\\", {\\n            keyPath: ii\\n        });\\n        const n = e.store(\\\"collectionParents\\\"), s = new cr, i = t => {\\n            if (s.add(t)) {\\n                const e = t.lastSegment(), s = t.popLast();\\n                return n.put({\\n                    collectionId: e,\\n                    parent: Gs(s)\\n                });\\n            }\\n        };\\n        // Helper to add an index entry iff we haven't already written it.\\n                // Index existing remote documents.\\n        return e.store(\\\"remoteDocuments\\\").Wt({\\n            jt: !0\\n        }, ((t, e) => {\\n            const n = new _t(t);\\n            return i(n.popLast());\\n        })).next((() => e.store(\\\"documentMutations\\\").Wt({\\n            jt: !0\\n        }, (([t, e, n], s) => {\\n            const r = Ws(e);\\n            return i(r.popLast());\\n        }))));\\n    }\\n    Hn(t) {\\n        const e = t.store(\\\"targets\\\");\\n        return e.Wt(((t, n) => {\\n            const s = Ui(n), i = qi(this.M, s);\\n            return e.put(i);\\n        }));\\n    }\\n    Jn(t, e) {\\n        const n = e.store(\\\"remoteDocuments\\\"), s = [];\\n        return n.Wt(((t, n) => {\\n            const i = e.store(\\\"remoteDocumentsV14\\\"), r = (o = n, o.document ? new xt(_t.fromString(o.document.name).popFirst(5)) : o.noDocument ? xt.fromSegments(o.noDocument.path) : o.unknownDocument ? xt.fromSegments(o.unknownDocument.path) : L()).path.toArray();\\n            var o;\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */            const u = {\\n                prefixPath: r.slice(0, r.length - 2),\\n                collectionGroup: r[r.length - 2],\\n                documentId: r[r.length - 1],\\n                readTime: n.readTime || [ 0, 0 ],\\n                unknownDocument: n.unknownDocument,\\n                noDocument: n.noDocument,\\n                document: n.document,\\n                hasCommittedMutations: !!n.hasCommittedMutations\\n            };\\n            s.push(i.put(u));\\n        })).next((() => yi.waitFor(s)));\\n    }\\n}\\n\\nfunction jr(t) {\\n    t.createObjectStore(\\\"targetDocuments\\\", {\\n        keyPath: ni\\n    }).createIndex(\\\"documentTargetsIndex\\\", si, {\\n        unique: !0\\n    });\\n    // NOTE: This is unique only because the TargetId is the suffix.\\n    t.createObjectStore(\\\"targets\\\", {\\n        keyPath: \\\"targetId\\\"\\n    }).createIndex(\\\"queryTargetsIndex\\\", ei, {\\n        unique: !0\\n    }), t.createObjectStore(\\\"targetGlobal\\\");\\n}\\n\\nconst Wr = \\\"Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.\\\";\\n\\n/**\\n * Oldest acceptable age in milliseconds for client metadata before the client\\n * is considered inactive and its associated data is garbage collected.\\n */\\n/**\\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\\n * across sessions.\\n *\\n * On Web only, the Firestore SDKs support shared access to its persistence\\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\\n * to synchronize state even without network connectivity. Shared access is\\n * currently optional and not enabled unless all clients invoke\\n * `enablePersistence()` with `{synchronizeTabs:true}`.\\n *\\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\\n * will designate one client as the “primary client”. An effort is made to pick\\n * a visible, network-connected and active client, and this client is\\n * responsible for letting other clients know about its presence. The primary\\n * client writes a unique client-generated identifier (the client ID) to\\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\\n * update this entry, another client can acquire the lease and take over as\\n * primary.\\n *\\n * Some persistence operations in the SDK are designated as primary-client only\\n * operations. This includes the acknowledgment of mutations and all updates of\\n * remote documents. The effects of these operations are written to persistence\\n * and then broadcast to other tabs via LocalStorage (see\\n * `WebStorageSharedClientState`), which then refresh their state from\\n * persistence.\\n *\\n * Similarly, the primary client listens to notifications sent by secondary\\n * clients to discover persistence changes written by secondary clients, such as\\n * the addition of new mutations and query targets.\\n *\\n * If multi-tab is not enabled and another tab already obtained the primary\\n * lease, IndexedDbPersistence enters a failed state and all subsequent\\n * operations will automatically fail.\\n *\\n * Additionally, there is an optimization so that when a tab is closed, the\\n * primary lease is released immediately (this is especially important to make\\n * sure that a refreshed tab is able to immediately re-acquire the primary\\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\\n * since it is an asynchronous API. So in addition to attempting to give up the\\n * lease, the leaseholder writes its client ID to a \\\"zombiedClient\\\" entry in\\n * LocalStorage which acts as an indicator that another tab should go ahead and\\n * take the primary lease immediately regardless of the current lease timestamp.\\n *\\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\\n * longer optional.\\n */\\nclass zr {\\n    constructor(\\n    /**\\n     * Whether to synchronize the in-memory state of multiple tabs and share\\n     * access to local persistence.\\n     */\\n    t, e, n, s, i, r, o, u, a, \\n    /**\\n     * If set to true, forcefully obtains database access. Existing tabs will\\n     * no longer be able to access IndexedDB.\\n     */\\n    c, h = 13) {\\n        if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, \\n        this.Yn = i, this.window = r, this.document = o, this.Xn = a, this.Zn = c, this.ts = h, \\n        this.es = null, this.ns = !1, this.isPrimary = !1, this.networkEnabled = !0, \\n        /** Our window.unload handler, if registered. */\\n        this.ss = null, this.inForeground = !1, \\n        /** Our 'visibilitychange' listener if registered. */\\n        this.rs = null, \\n        /** The client metadata refresh task. */\\n        this.os = null, \\n        /** The last time we garbage collected the client metadata object store. */\\n        this.us = Number.NEGATIVE_INFINITY, \\n        /** A listener to notify on primary state changes. */\\n        this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, \\\"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.\\\");\\n        this.referenceDelegate = new Mr(this, s), this.hs = e + \\\"main\\\", this.M = new ki(u), \\n        this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M), \\n        this.ds = function(t) {\\n            return new $r(t);\\n        }(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null, \\n        !1 === c && F(\\\"IndexedDbPersistence\\\", \\\"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.\\\"));\\n    }\\n    /**\\n     * Attempt to start IndexedDb persistence.\\n     *\\n     * @returns Whether persistence was enabled.\\n     */    start() {\\n        // NOTE: This is expected to fail sometimes (in the case of another tab\\n        // already having the persistence lock), so it's the first thing we should\\n        // do.\\n        return this.gs().then((() => {\\n            if (!this.isPrimary && !this.allowTabSynchronization) \\n            // Fail `start()` if `synchronizeTabs` is disabled and we cannot\\n            // obtain the primary lease.\\n            throw new Q(G.FAILED_PRECONDITION, Wr);\\n            return this.ys(), this.ps(), this.Is(), this.runTransaction(\\\"getHighestListenSequenceNumber\\\", \\\"readonly\\\", (t => this.fs.getHighestSequenceNumber(t)));\\n        })).then((t => {\\n            this.es = new nt(t, this.Xn);\\n        })).then((() => {\\n            this.ns = !0;\\n        })).catch((t => (this.ls && this.ls.close(), Promise.reject(t))));\\n    }\\n    /**\\n     * Registers a listener that gets called when the primary state of the\\n     * instance changes. Upon registering, this listener is invoked immediately\\n     * with the current primary state.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Ts(t) {\\n        return this.cs = async e => {\\n            if (this.started) return t(e);\\n        }, t(this.isPrimary);\\n    }\\n    /**\\n     * Registers a listener that gets called when the database receives a\\n     * version change event indicating that it has deleted.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setDatabaseDeletedListener(t) {\\n        this.ls.Ot((async e => {\\n            // Check if an attempt is made to delete IndexedDB.\\n            null === e.newVersion && await t();\\n        }));\\n    }\\n    /**\\n     * Adjusts the current network state in the client's metadata, potentially\\n     * affecting the primary lease.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    setNetworkEnabled(t) {\\n        this.networkEnabled !== t && (this.networkEnabled = t, \\n        // Schedule a primary lease refresh for immediate execution. The eventual\\n        // lease update will be propagated via `primaryStateListener`.\\n        this.Yn.enqueueAndForget((async () => {\\n            this.started && await this.gs();\\n        })));\\n    }\\n    /**\\n     * Updates the client metadata in IndexedDb and attempts to either obtain or\\n     * extend the primary lease for the local client. Asynchronously notifies the\\n     * primary state listener if the client either newly obtained or released its\\n     * primary lease.\\n     */    gs() {\\n        return this.runTransaction(\\\"updateClientMetadataAndTryBecomePrimary\\\", \\\"readwrite\\\", (t => Jr(t).put({\\n            clientId: this.clientId,\\n            updateTimeMs: Date.now(),\\n            networkEnabled: this.networkEnabled,\\n            inForeground: this.inForeground\\n        }).next((() => {\\n            if (this.isPrimary) return this.Es(t).next((t => {\\n                t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));\\n            }));\\n        })).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {\\n            if (Ai(t)) \\n            // Proceed with the existing state. Any subsequent access to\\n            // IndexedDB will verify the lease.\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Failed to extend owner lease: \\\", t), this.isPrimary;\\n            if (!this.allowTabSynchronization) throw t;\\n            return O(\\\"IndexedDbPersistence\\\", \\\"Releasing owner lease after error during lease refresh\\\", t), \\n            /* isPrimary= */ !1;\\n        })).then((t => {\\n            this.isPrimary !== t && this.Yn.enqueueRetryable((() => this.cs(t))), this.isPrimary = t;\\n        }));\\n    }\\n    Es(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => yi.resolve(this.Ps(t))));\\n    }\\n    Vs(t) {\\n        return Jr(t).delete(this.clientId);\\n    }\\n    /**\\n     * If the garbage collection threshold has passed, prunes the\\n     * RemoteDocumentChanges and the ClientMetadata store based on the last update\\n     * time of all clients.\\n     */    async vs() {\\n        if (this.isPrimary && !this.Ss(this.us, 18e5)) {\\n            this.us = Date.now();\\n            const t = await this.runTransaction(\\\"maybeGarbageCollectMultiClientState\\\", \\\"readwrite-primary\\\", (t => {\\n                const e = Si(t, \\\"clientMetadata\\\");\\n                return e.qt().next((t => {\\n                    const n = this.Ds(t, 18e5), s = t.filter((t => -1 === n.indexOf(t)));\\n                    // Delete metadata for clients that are no longer considered active.\\n                    return yi.forEach(s, (t => e.delete(t.clientId))).next((() => s));\\n                }));\\n            })).catch((() => []));\\n            // Delete potential leftover entries that may continue to mark the\\n            // inactive clients as zombied in LocalStorage.\\n            // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\\n            // the client atomically, but we can't. So we opt to delete the IndexedDb\\n            // entries first to avoid potentially reviving a zombied client.\\n                        if (this.ws) for (const e of t) this.ws.removeItem(this.Cs(e.clientId));\\n        }\\n    }\\n    /**\\n     * Schedules a recurring timer to update the client metadata and to either\\n     * extend or acquire the primary lease if the client is eligible.\\n     */    Is() {\\n        this.os = this.Yn.enqueueAfterDelay(\\\"client_metadata_refresh\\\" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));\\n    }\\n    /** Checks whether `client` is the local client. */    Ps(t) {\\n        return !!t && t.ownerId === this.clientId;\\n    }\\n    /**\\n     * Evaluate the state of all active clients and determine whether the local\\n     * client is or can act as the holder of the primary lease. Returns whether\\n     * the client is eligible for the lease, but does not actually acquire it.\\n     * May return 'false' even if there is no active leaseholder and another\\n     * (foreground) client should become leaseholder instead.\\n     */    As(t) {\\n        if (this.Zn) return yi.resolve(!0);\\n        return Hr(t).get(\\\"owner\\\").next((e => {\\n            // A client is eligible for the primary lease if:\\n            // - its network is enabled and the client's tab is in the foreground.\\n            // - its network is enabled and no other client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and the client's tab is in the\\n            //   foreground.\\n            // - every clients network is disabled and no other client's tab is in\\n            //   the foreground.\\n            // - the `forceOwningTab` setting was passed in.\\n            if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {\\n                if (this.Ps(e) && this.networkEnabled) return !0;\\n                if (!this.Ps(e)) {\\n                    if (!e.allowTabSynchronization) \\n                    // Fail the `canActAsPrimary` check if the current leaseholder has\\n                    // not opted into multi-tab synchronization. If this happens at\\n                    // client startup, we reject the Promise returned by\\n                    // `enablePersistence()` and the user can continue to use Firestore\\n                    // with in-memory persistence.\\n                    // If this fails during a lease refresh, we will instead block the\\n                    // AsyncQueue from executing further operations. Note that this is\\n                    // acceptable since mixing & matching different `synchronizeTabs`\\n                    // settings is not supported.\\n                    // TODO(b/114226234): Remove this check when `synchronizeTabs` can\\n                    // no longer be turned off.\\n                    throw new Q(G.FAILED_PRECONDITION, Wr);\\n                    return !1;\\n                }\\n            }\\n            return !(!this.networkEnabled || !this.inForeground) || Jr(t).qt().next((t => void 0 === this.Ds(t, 5e3).find((t => {\\n                if (this.clientId !== t.clientId) {\\n                    const e = !this.networkEnabled && t.networkEnabled, n = !this.inForeground && t.inForeground, s = this.networkEnabled === t.networkEnabled;\\n                    if (e || n && s) return !0;\\n                }\\n                return !1;\\n            }))));\\n        })).next((t => (this.isPrimary !== t && O(\\\"IndexedDbPersistence\\\", `Client ${t ? \\\"is\\\" : \\\"is not\\\"} eligible for a primary lease.`), \\n        t)));\\n    }\\n    async shutdown() {\\n        // The shutdown() operations are idempotent and can be called even when\\n        // start() aborted (e.g. because it couldn't acquire the persistence lease).\\n        this.ns = !1, this.Ns(), this.os && (this.os.cancel(), this.os = null), this.ks(), \\n        this.Ms(), \\n        // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\\n        // has obtained the primary lease.\\n        await this.ls.runTransaction(\\\"shutdown\\\", \\\"readwrite\\\", [ \\\"owner\\\", \\\"clientMetadata\\\" ], (t => {\\n            const e = new vi(t, nt.A);\\n            return this.Rs(e).next((() => this.Vs(e)));\\n        })), this.ls.close(), \\n        // Remove the entry marking the client as zombied from LocalStorage since\\n        // we successfully deleted its metadata from IndexedDb.\\n        this.Os();\\n    }\\n    /**\\n     * Returns clients that are not zombied and have an updateTime within the\\n     * provided threshold.\\n     */    Ds(t, e) {\\n        return t.filter((t => this.Ss(t.updateTimeMs, e) && !this.xs(t.clientId)));\\n    }\\n    /**\\n     * Returns the IDs of the clients that are currently active. If multi-tab\\n     * is not supported, returns an array that only contains the local client's\\n     * ID.\\n     *\\n     * PORTING NOTE: This is only used for Web multi-tab.\\n     */    Fs() {\\n        return this.runTransaction(\\\"getActiveClients\\\", \\\"readonly\\\", (t => Jr(t).qt().next((t => this.Ds(t, 18e5).map((t => t.clientId))))));\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    getMutationQueue(t, e) {\\n        return Ir.Yt(t, this.M, e, this.referenceDelegate);\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getIndexManager(t) {\\n        return new lr(t, this.M.Jt.databaseId);\\n    }\\n    getDocumentOverlayCache(t) {\\n        return Hi.Yt(this.M, t);\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"IndexedDbPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = \\\"readonly\\\" === e ? \\\"readonly\\\" : \\\"readwrite\\\", i = 14 === (r = this.ts) ? wi : 13 === r ? _i : 12 === r ? di : 11 === r ? fi : void L();\\n        /** Returns the object stores for the provided schema. */\\n        var r;\\n        let o;\\n        // Do all transactions as readwrite against all object stores, since we\\n        // are the only reader/writer.\\n                return this.ls.runTransaction(t, s, i, (s => (o = new vi(s, this.es ? this.es.next() : nt.A), \\n        \\\"readwrite-primary\\\" === e ? this.Es(o).next((t => !!t || this.As(o))).next((e => {\\n            if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1, \\n            this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);\\n            return n(o);\\n        })).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    /**\\n     * Verifies that the current tab is the primary leaseholder or alternatively\\n     * that the leaseholder has opted into multi-tab synchronization.\\n     */\\n    // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\\n    // be turned off.\\n    $s(t) {\\n        return Hr(t).get(\\\"owner\\\").next((t => {\\n            if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);\\n        }));\\n    }\\n    /**\\n     * Obtains or extends the new primary lease for the local client. This\\n     * method does not verify that the client is eligible for this lease.\\n     */    bs(t) {\\n        const e = {\\n            ownerId: this.clientId,\\n            allowTabSynchronization: this.allowTabSynchronization,\\n            leaseTimestampMs: Date.now()\\n        };\\n        return Hr(t).put(\\\"owner\\\", e);\\n    }\\n    static vt() {\\n        return Ii.vt();\\n    }\\n    /** Checks the primary lease and removes it if we are the current primary. */    Rs(t) {\\n        const e = Hr(t);\\n        return e.get(\\\"owner\\\").next((t => this.Ps(t) ? (O(\\\"IndexedDbPersistence\\\", \\\"Releasing primary lease.\\\"), \\n        e.delete(\\\"owner\\\")) : yi.resolve()));\\n    }\\n    /** Verifies that `updateTimeMs` is within `maxAgeMs`. */    Ss(t, e) {\\n        const n = Date.now();\\n        return !(t < n - e) && (!(t > n) || (F(`Detected an update time that is in the future: ${t} > ${n}`), \\n        !1));\\n    }\\n    ys() {\\n        null !== this.document && \\\"function\\\" == typeof this.document.addEventListener && (this.rs = () => {\\n            this.Yn.enqueueAndForget((() => (this.inForeground = \\\"visible\\\" === this.document.visibilityState, \\n            this.gs())));\\n        }, this.document.addEventListener(\\\"visibilitychange\\\", this.rs), this.inForeground = \\\"visible\\\" === this.document.visibilityState);\\n    }\\n    ks() {\\n        this.rs && (this.document.removeEventListener(\\\"visibilitychange\\\", this.rs), this.rs = null);\\n    }\\n    /**\\n     * Attaches a window.unload handler that will synchronously write our\\n     * clientId to a \\\"zombie client id\\\" location in LocalStorage. This can be used\\n     * by tabs trying to acquire the primary lease to determine that the lease\\n     * is no longer valid even if the timestamp is recent. This is particularly\\n     * important for the refresh case (so the tab correctly re-acquires the\\n     * primary lease). LocalStorage is used for this rather than IndexedDb because\\n     * it is a synchronous API and so can be used reliably from  an unload\\n     * handler.\\n     */    ps() {\\n        var t;\\n        \\\"function\\\" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.ss = () => {\\n            // Note: In theory, this should be scheduled on the AsyncQueue since it\\n            // accesses internal state. We execute this code directly during shutdown\\n            // to make sure it gets a chance to run.\\n            this.Ns(), (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isSafari)() && navigator.appVersion.match(/Version\\\\/1[45]/) && \\n            // On Safari 14 and 15, we do not run any cleanup actions as it might\\n            // trigger a bug that prevents Safari from re-opening IndexedDB during\\n            // the next page load.\\n            // See https://bugs.webkit.org/show_bug.cgi?id=226547\\n            this.Yn.enterRestrictedMode(/* purgeExistingTasks= */ !0), this.Yn.enqueueAndForget((() => this.shutdown()));\\n        }, this.window.addEventListener(\\\"pagehide\\\", this.ss));\\n    }\\n    Ms() {\\n        this.ss && (this.window.removeEventListener(\\\"pagehide\\\", this.ss), this.ss = null);\\n    }\\n    /**\\n     * Returns whether a client is \\\"zombied\\\" based on its LocalStorage entry.\\n     * Clients become zombied when their tab closes without running all of the\\n     * cleanup logic in `shutdown()`.\\n     */    xs(t) {\\n        var e;\\n        try {\\n            const n = null !== (null === (e = this.ws) || void 0 === e ? void 0 : e.getItem(this.Cs(t)));\\n            return O(\\\"IndexedDbPersistence\\\", `Client '${t}' ${n ? \\\"is\\\" : \\\"is not\\\"} zombied in LocalStorage`), \\n            n;\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't working.\\n            return F(\\\"IndexedDbPersistence\\\", \\\"Failed to get zombied client id.\\\", t), !1;\\n        }\\n    }\\n    /**\\n     * Record client as zombied (a client that had its tab closed). Zombied\\n     * clients are ignored during primary tab selection.\\n     */    Ns() {\\n        if (this.ws) try {\\n            this.ws.setItem(this.Cs(this.clientId), String(Date.now()));\\n        } catch (t) {\\n            // Gracefully handle if LocalStorage isn't available / working.\\n            F(\\\"Failed to set zombie client id.\\\", t);\\n        }\\n    }\\n    /** Removes the zombied client entry if it exists. */    Os() {\\n        if (this.ws) try {\\n            this.ws.removeItem(this.Cs(this.clientId));\\n        } catch (t) {\\n            // Ignore\\n        }\\n    }\\n    Cs(t) {\\n        return `firestore_zombie_${this.persistenceKey}_${t}`;\\n    }\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the primary client object store.\\n */ function Hr(t) {\\n    return Si(t, \\\"owner\\\");\\n}\\n\\n/**\\n * Helper to get a typed SimpleDbStore for the client metadata object store.\\n */ function Jr(t) {\\n    return Si(t, \\\"clientMetadata\\\");\\n}\\n\\n/**\\n * Generates a string used as a prefix when storing data in IndexedDB and\\n * LocalStorage.\\n */ function Yr(t, e) {\\n    // Use two different prefix formats:\\n    //   * firestore / persistenceKey / projectID . databaseID / ...\\n    //   * firestore / persistenceKey / projectID / ...\\n    // projectIDs are DNS-compatible names and cannot contain dots\\n    // so there's no danger of collisions.\\n    let n = t.projectId;\\n    return t.isDefaultDatabase || (n += \\\".\\\" + t.database), \\\"firestore/\\\" + e + \\\"/\\\" + n + \\\"/\\\";\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A readonly view of the local state of all documents we're tracking (i.e. we\\n * have a cached version in remoteDocumentCache or local mutations for the\\n * document). The view is computed by applying the mutations in the\\n * MutationQueue to the RemoteDocumentCache.\\n */\\nclass Xr {\\n    constructor(t, e, n) {\\n        this.ds = t, this.Bs = e, this.indexManager = n;\\n    }\\n    /**\\n     * Get the local view of the document identified by `key`.\\n     *\\n     * @returns Local view of the document or null if we don't have any cached\\n     * state for it.\\n     */    Ls(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKey(t, e).next((n => this.Us(t, e, n)));\\n    }\\n    /** Internal version of `getDocument` that allows reusing batches. */    Us(t, e, n) {\\n        return this.ds.getEntry(t, e).next((t => {\\n            for (const e of n) e.applyToLocalView(t);\\n            return t;\\n        }));\\n    }\\n    // Returns the view of the given `docs` as they would appear after applying\\n    // all mutations in the given `batches`.\\n    qs(t, e) {\\n        t.forEach(((t, n) => {\\n            for (const t of e) t.applyToLocalView(n);\\n        }));\\n    }\\n    /**\\n     * Gets the local view of the documents identified by `keys`.\\n     *\\n     * If we don't have cached state for a document in `keys`, a NoDocument will\\n     * be stored for that key in the resulting set.\\n     */    Ks(t, e) {\\n        return this.ds.getEntries(t, e).next((e => this.Gs(t, e).next((() => e))));\\n    }\\n    /**\\n     * Applies the local view the given `baseDocs` without retrieving documents\\n     * from the local store.\\n     */    Gs(t, e) {\\n        return this.Bs.getAllMutationBatchesAffectingDocumentKeys(t, e).next((t => this.qs(e, t)));\\n    }\\n    /**\\n     * Performs a query against the local view of all documents.\\n     *\\n     * @param transaction - The persistence transaction.\\n     * @param query - The query to match documents against.\\n     * @param offset - Read time and key to start scanning by (exclusive).\\n     */    Qs(t, e, n) {\\n        /**\\n * Returns whether the query matches a single document by path (rather than a\\n * collection).\\n */\\n        return function(t) {\\n            return xt.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length;\\n        }(e) ? this.js(t, e.path) : We(e) ? this.Ws(t, e, n) : this.zs(t, e, n);\\n    }\\n    js(t, e) {\\n        // Just do a simple document lookup.\\n        return this.Ls(t, new xt(e)).next((t => {\\n            let e = Wn();\\n            return t.isFoundDocument() && (e = e.insert(t.key, t)), e;\\n        }));\\n    }\\n    Ws(t, e, n) {\\n        const s = e.collectionGroup;\\n        let i = Wn();\\n        return this.indexManager.getCollectionParents(t, s).next((r => yi.forEach(r, (r => {\\n            const o = function(t, e) {\\n                return new Ue(e, \\n                /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n            }(e, r.child(s));\\n            return this.zs(t, o, n).next((t => {\\n                t.forEach(((t, e) => {\\n                    i = i.insert(t, e);\\n                }));\\n            }));\\n        })).next((() => i))));\\n    }\\n    zs(t, e, n) {\\n        // Query the remote documents and overlay mutations.\\n        let s;\\n        return this.ds.getAllFromCollection(t, e.path, n).next((n => (s = n, this.Bs.getAllMutationBatchesAffectingQuery(t, e)))).next((t => {\\n            for (const e of t) for (const t of e.mutations) {\\n                const n = t.key;\\n                let i = s.get(n);\\n                null == i && (\\n                // Create invalid document to apply mutations on top of\\n                i = ne.newInvalidDocument(n), s = s.insert(n, i)), Vn(t, i, e.localWriteTime), i.isFoundDocument() || (s = s.remove(n));\\n            }\\n        })).next((() => (\\n        // Finally, filter out any documents that don't actually match\\n        // the query.\\n        s.forEach(((t, n) => {\\n            tn(e, n) || (s = s.remove(t));\\n        })), s)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A set of changes to what documents are currently in view and out of view for\\n * a given query. These changes are sent to the LocalStore by the View (via\\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\\n */ class Zr {\\n    constructor(t, e, n, s) {\\n        this.targetId = t, this.fromCache = e, this.Hs = n, this.Js = s;\\n    }\\n    static Ys(t, e) {\\n        let n = Yn(), s = Yn();\\n        for (const t of e.docChanges) switch (t.type) {\\n          case 0 /* Added */ :\\n            n = n.add(t.doc.key);\\n            break;\\n\\n          case 1 /* Removed */ :\\n            s = s.add(t.doc.key);\\n // do nothing\\n                }\\n        return new Zr(t, e.fromCache, n, s);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Firestore query engine.\\n *\\n * Firestore queries can be executed in three modes. The Query Engine determines\\n * what mode to use based on what data is persisted. The mode only determines\\n * the runtime complexity of the query - the result set is equivalent across all\\n * implementations.\\n *\\n * The Query engine will use indexed-based execution if a user has configured\\n * any index that can be used to execute query (via `setIndexConfiguration()`).\\n * Otherwise, the engine will try to optimize the query by re-using a previously\\n * persisted query result. If that is not possible, the query will be executed\\n * via a full collection scan.\\n *\\n * Index-based execution is the default when available. The query engine\\n * supports partial indexed execution and merges the result from the index\\n * lookup with documents that have not yet been indexed. The index evaluation\\n * matches the backend's format and as such, the SDK can use indexing for all\\n * queries that the backend supports.\\n *\\n * If no index exists, the query engine tries to take advantage of the target\\n * document mapping in the TargetCache. These mappings exists for all queries\\n * that have been synced with the backend at least once and allow the query\\n * engine to only read documents that previously matched a query plus any\\n * documents that were edited after the query was last listened to.\\n *\\n * There are some cases when this optimization is not guaranteed to produce\\n * the same results as full collection scans. In these cases, query\\n * processing falls back to full scans. These cases are:\\n *\\n * - Limit queries where a document that matched the query previously no longer\\n *   matches the query.\\n *\\n * - Limit queries where a document edit may cause the document to sort below\\n *   another document that is in the local cache.\\n *\\n * - Queries that have never been CURRENT or free of limbo documents.\\n */ class to {\\n    constructor() {\\n        this.Xs = !1;\\n    }\\n    /** Sets the document view to query against. */    initialize(t, e) {\\n        this.Zs = t, this.indexManager = e, this.Xs = !0;\\n    }\\n    /** Returns all local documents matching the specified query. */    Qs(t, e, n, s) {\\n        return this.ti(t, e).next((i => i || this.ei(t, e, s, n))).next((n => n || this.ni(t, e)));\\n    }\\n    /**\\n     * Performs an indexed query that evaluates the query based on a collection's\\n     * persisted index values. Returns `null` if an index is not available.\\n     */    ti(t, e) {\\n        return yi.resolve(null);\\n    }\\n    /**\\n     * Performs a query based on the target's persisted query mapping. Returns\\n     * `null` if the mapping is not available or cannot be used.\\n     */    ei(t, e, n, s) {\\n        return Ge(e) || s.isEqual(ct.min()) ? this.ni(t, e) : this.Zs.Ks(t, n).next((i => {\\n            const r = this.si(e, i);\\n            return this.ii(e, r, n, s) ? this.ni(t, e) : (k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Re-using previous result from %s to execute query: %s\\\", s.toString(), Ze(e)), \\n            this.ri(t, r, e, ae(s, -1)));\\n        }));\\n        // Queries that have never seen a snapshot without limbo free documents\\n        // should also be run as a full collection scan.\\n        }\\n    /** Applies the query filter and sorting to the provided documents.  */    si(t, e) {\\n        // Sort the documents and re-apply the query filter since previously\\n        // matching documents do not necessarily still match the query.\\n        let n = new we(nn(t));\\n        return e.forEach(((e, s) => {\\n            tn(t, s) && (n = n.add(s));\\n        })), n;\\n    }\\n    /**\\n     * Determines if a limit query needs to be refilled from cache, making it\\n     * ineligible for index-free execution.\\n     *\\n     * @param query The query.\\n     * @param sortedPreviousResults - The documents that matched the query when it\\n     * was last synchronized, sorted by the query's comparator.\\n     * @param remoteKeys - The document keys that matched the query at the last\\n     * snapshot.\\n     * @param limboFreeSnapshotVersion - The version of the snapshot when the\\n     * query was last synchronized.\\n     */    ii(t, e, n, s) {\\n        if (null === t.limit) \\n        // Queries without limits do not need to be refilled.\\n        return !1;\\n        if (n.size !== e.size) \\n        // The query needs to be refilled if a previously matching document no\\n        // longer matches.\\n        return !0;\\n        // Limit queries are not eligible for index-free query execution if there is\\n        // a potential that an older document from cache now sorts before a document\\n        // that was previously part of the limit. This, however, can only happen if\\n        // the document at the edge of the limit goes out of limit.\\n        // If a document that is not the limit boundary sorts differently,\\n        // the boundary of the limit itself did not change and documents from cache\\n        // will continue to be \\\"rejected\\\" by this boundary. Therefore, we can ignore\\n        // any modifications that don't affect the last document.\\n                const i = \\\"F\\\" /* First */ === t.limitType ? e.last() : e.first();\\n        return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\\n    }\\n    ni(t, e) {\\n        return k() <= _firebase_logger__WEBPACK_IMPORTED_MODULE_2__.LogLevel.DEBUG && O(\\\"QueryEngine\\\", \\\"Using full collection scan to execute query:\\\", Ze(e)), \\n        this.Zs.Qs(t, e, he.min());\\n    }\\n    /**\\n     * Combines the results from an indexed execution with the remaining documents\\n     * that have not yet been indexed.\\n     */    ri(t, e, n, s) {\\n        // Retrieve all results for documents that were updated since the offset.\\n        return this.Zs.Qs(t, n, s).next((t => (\\n        // Merge with existing results\\n        e.forEach((e => {\\n            t = t.insert(e.key, e);\\n        })), t)));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Implements `LocalStore` interface.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */\\nclass eo {\\n    constructor(\\n    /** Manages our in-memory or durable persistence. */\\n    t, e, n, s) {\\n        this.persistence = t, this.oi = e, this.M = s, \\n        /**\\n         * Maps a targetID to data about its target.\\n         *\\n         * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\\n         * of `applyRemoteEvent()` idempotent.\\n         */\\n        this.ui = new fe(rt), \\n        /** Maps a target to its targetID. */\\n        // TODO(wuandy): Evaluate if TargetId can be part of Target.\\n        this.ai = new Kn((t => Ie(t)), Ee), \\n        /**\\n         * A per collection group index of the last read time processed by\\n         * `getNewDocumentChanges()`.\\n         *\\n         * PORTING NOTE: This is only used for multi-tab synchronization.\\n         */\\n        this.ci = new Map, this.hi = t.getRemoteDocumentCache(), this.fs = t.getTargetCache(), \\n        this._s = t.getBundleCache(), this.li(n);\\n    }\\n    li(t) {\\n        // TODO(indexing): Add spec tests that test these components change after a\\n        // user change\\n        this.indexManager = this.persistence.getIndexManager(t), this.Bs = this.persistence.getMutationQueue(t, this.indexManager), \\n        this.fi = new Xr(this.hi, this.Bs, this.indexManager), this.hi.setIndexManager(this.indexManager), \\n        this.oi.initialize(this.fi, this.indexManager);\\n    }\\n    collectGarbage(t) {\\n        return this.persistence.runTransaction(\\\"Collect garbage\\\", \\\"readwrite-primary\\\", (e => t.collect(e, this.ui)));\\n    }\\n}\\n\\nfunction no(\\n/** Manages our in-memory or durable persistence. */\\nt, e, n, s) {\\n    return new eo(t, e, n, s);\\n}\\n\\n/**\\n * Tells the LocalStore that the currently authenticated user has changed.\\n *\\n * In response the local store switches the mutation queue to the new user and\\n * returns any resulting document changes.\\n */\\n// PORTING NOTE: Android and iOS only return the documents affected by the\\n// change.\\nasync function so(t, e) {\\n    const n = K(t);\\n    return await n.persistence.runTransaction(\\\"Handle user change\\\", \\\"readonly\\\", (t => {\\n        // Swap out the mutation queue, grabbing the pending mutation batches\\n        // before and after.\\n        let s;\\n        return n.Bs.getAllMutationBatches(t).next((i => (s = i, n.li(e), n.Bs.getAllMutationBatches(t)))).next((e => {\\n            const i = [], r = [];\\n            // Union the old/new changed keys.\\n            let o = Yn();\\n            for (const t of s) {\\n                i.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            for (const t of e) {\\n                r.push(t.batchId);\\n                for (const e of t.mutations) o = o.add(e.key);\\n            }\\n            // Return the set of all (potentially) changed documents and the list\\n            // of mutation batch IDs that were affected by change.\\n                        return n.fi.Ks(t, o).next((t => ({\\n                di: t,\\n                removedBatchIds: i,\\n                addedBatchIds: r\\n            })));\\n        }));\\n    }));\\n}\\n\\n/* Accepts locally generated Mutations and commit them to storage. */\\n/**\\n * Acknowledges the given batch.\\n *\\n * On the happy path when a batch is acknowledged, the local store will\\n *\\n *  + remove the batch from the mutation queue;\\n *  + apply the changes to the remote document cache;\\n *  + recalculate the latency compensated view implied by those changes (there\\n *    may be mutations in the queue that affect the documents but haven't been\\n *    acknowledged yet); and\\n *  + give the changed documents back the sync engine\\n *\\n * @returns The resulting (modified) documents.\\n */\\nfunction io(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Acknowledge batch\\\", \\\"readwrite-primary\\\", (t => {\\n        const s = e.batch.keys(), i = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        return function(t, e, n, s) {\\n            const i = n.batch, r = i.keys();\\n            let o = yi.resolve();\\n            return r.forEach((t => {\\n                o = o.next((() => s.getEntry(e, t))).next((e => {\\n                    const r = n.docVersions.get(t);\\n                    U(null !== r), e.version.compareTo(r) < 0 && (i.applyToRemoteDocument(e, n), e.isValidDocument() && (\\n                    // We use the commitVersion as the readTime rather than the\\n                    // document's updateTime since the updateTime is not advanced\\n                    // for updates that do not modify the underlying document.\\n                    e.setReadTime(n.commitVersion), s.addEntry(e)));\\n                }));\\n            })), o.next((() => t.Bs.removeMutationBatch(e, i)));\\n        }\\n        /** Returns the local view of the documents affected by a mutation batch. */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n, t, e, i).next((() => i.apply(t))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n    }));\\n}\\n\\n/**\\n * Removes mutations from the MutationQueue for the specified batch;\\n * LocalDocuments will be recalculated.\\n *\\n * @returns The resulting modified documents.\\n */\\n/**\\n * Returns the last consistent snapshot processed (used by the RemoteStore to\\n * determine whether to buffer incoming snapshots from the backend).\\n */\\nfunction ro(t) {\\n    const e = K(t);\\n    return e.persistence.runTransaction(\\\"Get last remote snapshot version\\\", \\\"readonly\\\", (t => e.fs.getLastRemoteSnapshotVersion(t)));\\n}\\n\\n/**\\n * Updates the \\\"ground-state\\\" (remote) documents. We assume that the remote\\n * event reflects any write batches that have been acknowledged or rejected\\n * (i.e. we do not re-apply local mutations to updates from this event).\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */ function oo(t, e) {\\n    const n = K(t), s = e.snapshotVersion;\\n    let i = n.ui;\\n    return n.persistence.runTransaction(\\\"Apply remote event\\\", \\\"readwrite-primary\\\", (t => {\\n        const r = n.hi.newChangeBuffer({\\n            trackRemovals: !0\\n        });\\n        // Reset newTargetDataByTargetMap in case this transaction gets re-run.\\n                i = n.ui;\\n        const o = [];\\n        e.targetChanges.forEach(((r, u) => {\\n            const a = i.get(u);\\n            if (!a) return;\\n            // Only update the remote keys if the target is still active. This\\n            // ensures that we can persist the updated target data along with\\n            // the updated assignment.\\n                        o.push(n.fs.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.fs.addMatchingKeys(t, r.addedDocuments, u))));\\n            let c = a.withSequenceNumber(t.currentSequenceNumber);\\n            e.targetMismatches.has(u) ? c = c.withResumeToken(pt.EMPTY_BYTE_STRING, ct.min()).withLastLimboFreeSnapshotVersion(ct.min()) : r.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(r.resumeToken, s)), \\n            i = i.insert(u, c), \\n            // Update the target data if there are target changes (or if\\n            // sufficient time has passed since the last update).\\n            /**\\n * Returns true if the newTargetData should be persisted during an update of\\n * an active target. TargetData should always be persisted when a target is\\n * being released and should not call this function.\\n *\\n * While the target is active, TargetData updates can be omitted when nothing\\n * about the target has changed except metadata like the resume token or\\n * snapshot version. Occasionally it's worth the extra write to prevent these\\n * values from getting too stale after a crash, but this doesn't have to be\\n * too frequent.\\n */\\n            function(t, e, n) {\\n                // Always persist target data if we don't already have a resume token.\\n                if (0 === t.resumeToken.approximateByteSize()) return !0;\\n                // Don't allow resume token changes to be buffered indefinitely. This\\n                // allows us to be reasonably up-to-date after a crash and avoids needing\\n                // to loop over all active queries on shutdown. Especially in the browser\\n                // we may not get time to do anything interesting while the current tab is\\n                // closing.\\n                                if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;\\n                // Otherwise if the only thing that has changed about a target is its resume\\n                // token it's not worth persisting. Note that the RemoteStore keeps an\\n                // in-memory view of the currently active targets which includes the current\\n                // resume token, so stream failure or user changes will still use an\\n                // up-to-date resume token regardless of what we do here.\\n                                return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;\\n            }\\n            /**\\n * Notifies local store of the changed views to locally pin documents.\\n */ (a, c, r) && o.push(n.fs.updateTargetData(t, c));\\n        }));\\n        let u = Qn();\\n        // HACK: The only reason we allow a null snapshot version is so that we\\n        // can synthesize remote events when we get permission denied errors while\\n        // trying to resolve the state of a locally cached document that is in\\n        // limbo.\\n        if (e.documentUpdates.forEach((s => {\\n            e.resolvedLimboDocuments.has(s) && o.push(n.persistence.referenceDelegate.updateLimboDocument(t, s));\\n        })), \\n        // Each loop iteration only affects its \\\"own\\\" doc, so it's safe to get all the remote\\n        // documents in advance in a single call.\\n        o.push(uo(t, r, e.documentUpdates).next((t => {\\n            u = t;\\n        }))), !s.isEqual(ct.min())) {\\n            const e = n.fs.getLastRemoteSnapshotVersion(t).next((e => n.fs.setTargetsMetadata(t, t.currentSequenceNumber, s)));\\n            o.push(e);\\n        }\\n        return yi.waitFor(o).next((() => r.apply(t))).next((() => n.fi.Gs(t, u))).next((() => u));\\n    })).then((t => (n.ui = i, t)));\\n}\\n\\n/**\\n * Populates document change buffer with documents from backend or a bundle.\\n * Returns the document changes resulting from applying those documents.\\n *\\n * @param txn - Transaction to use to read existing documents from storage.\\n * @param documentBuffer - Document buffer to collect the resulted changes to be\\n *        applied to storage.\\n * @param documents - Documents to be applied.\\n * @param globalVersion - A `SnapshotVersion` representing the read time if all\\n *        documents have the same read time.\\n * @param documentVersions - A DocumentKey-to-SnapshotVersion map if documents\\n *        have their own read time.\\n *\\n * Note: this function will use `documentVersions` if it is defined;\\n * when it is not defined, resorts to `globalVersion`.\\n */ function uo(t, e, n) {\\n    let s = Yn();\\n    return n.forEach((t => s = s.add(t))), e.getEntries(t, s).next((t => {\\n        let s = Qn();\\n        return n.forEach(((n, i) => {\\n            const r = t.get(n);\\n            // Note: The order of the steps below is important, since we want\\n            // to ensure that rejected limbo resolutions (which fabricate\\n            // NoDocuments with SnapshotVersion.min()) never add documents to\\n            // cache.\\n                        i.isNoDocument() && i.version.isEqual(ct.min()) ? (\\n            // NoDocuments with SnapshotVersion.min() are used in manufactured\\n            // events. We remove these documents from cache since we lost\\n            // access.\\n            e.removeEntry(n, i.readTime), s = s.insert(n, i)) : !r.isValidDocument() || i.version.compareTo(r.version) > 0 || 0 === i.version.compareTo(r.version) && r.hasPendingWrites ? (e.addEntry(i), \\n            s = s.insert(n, i)) : O(\\\"LocalStore\\\", \\\"Ignoring outdated watch update for \\\", n, \\\". Current version:\\\", r.version, \\\" Watch version:\\\", i.version);\\n        })), s;\\n    }));\\n}\\n\\n/**\\n * Gets the mutation batch after the passed in batchId in the mutation queue\\n * or null if empty.\\n * @param afterBatchId - If provided, the batch to search after.\\n * @returns The next mutation or null if there wasn't one.\\n */\\nfunction ao(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Get next mutation batch\\\", \\\"readonly\\\", (t => (void 0 === e && (e = -1), \\n    n.Bs.getNextMutationBatchAfterBatchId(t, e))));\\n}\\n\\n/**\\n * Reads the current value of a Document with a given key or null if not\\n * found - used for testing.\\n */\\n/**\\n * Assigns the given target an internal ID so that its results can be pinned so\\n * they don't get GC'd. A target must be allocated in the local store before\\n * the store can be used to manage its view.\\n *\\n * Allocating an already allocated `Target` will return the existing `TargetData`\\n * for that `Target`.\\n */\\nfunction co(t, e) {\\n    const n = K(t);\\n    return n.persistence.runTransaction(\\\"Allocate target\\\", \\\"readwrite\\\", (t => {\\n        let s;\\n        return n.fs.getTargetData(t, e).next((i => i ? (\\n        // This target has been listened to previously, so reuse the\\n        // previous targetID.\\n        // TODO(mcg): freshen last accessed date?\\n        s = i, yi.resolve(s)) : n.fs.allocateTargetId(t).next((i => (s = new Ni(e, i, 0 /* Listen */ , t.currentSequenceNumber), \\n        n.fs.addTargetData(t, s).next((() => s)))))));\\n    })).then((t => {\\n        // If Multi-Tab is enabled, the existing target data may be newer than\\n        // the in-memory data\\n        const s = n.ui.get(t.targetId);\\n        return (null === s || t.snapshotVersion.compareTo(s.snapshotVersion) > 0) && (n.ui = n.ui.insert(t.targetId, t), \\n        n.ai.set(e, t.targetId)), t;\\n    }));\\n}\\n\\n/**\\n * Returns the TargetData as seen by the LocalStore, including updates that may\\n * have not yet been persisted to the TargetCache.\\n */\\n// Visible for testing.\\n/**\\n * Unpins all the documents associated with the given target. If\\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\\n * directly removes the associated target data from the target cache.\\n *\\n * Releasing a non-existing `Target` is a no-op.\\n */\\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\\nasync function ho(t, e, n) {\\n    const s = K(t), i = s.ui.get(e), r = n ? \\\"readwrite\\\" : \\\"readwrite-primary\\\";\\n    try {\\n        n || await s.persistence.runTransaction(\\\"Release target\\\", r, (t => s.persistence.referenceDelegate.removeTarget(t, i)));\\n    } catch (t) {\\n        if (!Ai(t)) throw t;\\n        // All `releaseTarget` does is record the final metadata state for the\\n        // target, but we've been recording this periodically during target\\n        // activity. If we lose this write this could cause a very slight\\n        // difference in the order of target deletion during GC, but we\\n        // don't define exact LRU semantics so this is acceptable.\\n        O(\\\"LocalStore\\\", `Failed to update sequence numbers for target ${e}: ${t}`);\\n    }\\n    s.ui = s.ui.remove(e), s.ai.delete(i.target);\\n}\\n\\n/**\\n * Runs the specified query against the local store and returns the results,\\n * potentially taking advantage of query data from previous executions (such\\n * as the set of remote keys).\\n *\\n * @param usePreviousResults - Whether results from previous executions can\\n * be used to optimize this query execution.\\n */ function lo(t, e, n) {\\n    const s = K(t);\\n    let i = ct.min(), r = Yn();\\n    return s.persistence.runTransaction(\\\"Execute query\\\", \\\"readonly\\\", (t => function(t, e, n) {\\n        const s = K(t), i = s.ai.get(n);\\n        return void 0 !== i ? yi.resolve(s.ui.get(i)) : s.fs.getTargetData(e, n);\\n    }(s, t, He(e)).next((e => {\\n        if (e) return i = e.lastLimboFreeSnapshotVersion, s.fs.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            r = t;\\n        }));\\n    })).next((() => s.oi.Qs(t, e, n ? i : ct.min(), n ? r : Yn()))).next((t => (wo(s, en(e), t), \\n    {\\n        documents: t,\\n        _i: r\\n    })))));\\n}\\n\\n// PORTING NOTE: Multi-Tab only.\\nfunction fo(t, e) {\\n    const n = K(t), s = K(n.fs), i = n.ui.get(e);\\n    return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\\\"Get target data\\\", \\\"readonly\\\", (t => s.Et(t, e).next((t => t ? t.target : null))));\\n}\\n\\n/**\\n * Returns the set of documents that have been updated since the last call.\\n * If this is the first call, returns the set of changes since client\\n * initialization. Further invocations will return document that have changed\\n * since the prior call.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction _o(t, e) {\\n    const n = K(t), s = n.ci.get(e) || ct.min();\\n    // Get the current maximum read time for the collection. This should always\\n    // exist, but to reduce the chance for regressions we default to\\n    // SnapshotVersion.Min()\\n    // TODO(indexing): Consider removing the default value.\\n        return n.persistence.runTransaction(\\\"Get new document changes\\\", \\\"readonly\\\", (t => n.hi.getAllFromCollectionGroup(t, e, ae(s, -1), \\n    /* limit= */ Number.MAX_SAFE_INTEGER))).then((t => (wo(n, e, t), t)));\\n}\\n\\n/** Sets the collection group's maximum read time from the given documents. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction wo(t, e, n) {\\n    let s = ct.min();\\n    n.forEach(((t, e) => {\\n        e.readTime.compareTo(s) > 0 && (s = e.readTime);\\n    })), t.ci.set(e, s);\\n}\\n\\n/**\\n * Creates a new target using the given bundle name, which will be used to\\n * hold the keys of all documents from the bundle in query-document mappings.\\n * This ensures that the loaded documents do not get garbage collected\\n * right away.\\n */\\n/**\\n * Applies the documents from a bundle to the \\\"ground-state\\\" (remote)\\n * documents.\\n *\\n * LocalDocuments are re-calculated if there are remaining mutations in the\\n * queue.\\n */\\nasync function mo(t, e, n, s) {\\n    const i = K(t);\\n    let r = Yn(), o = Qn();\\n    for (const t of n) {\\n        const n = e.wi(t.metadata.name);\\n        t.document && (r = r.add(n));\\n        const s = e.mi(t);\\n        s.setReadTime(e.gi(t.metadata.readTime)), o = o.insert(n, s);\\n    }\\n    const u = i.hi.newChangeBuffer({\\n        trackRemovals: !0\\n    }), a = await co(i, function(t) {\\n        // It is OK that the path used for the query is not valid, because this will\\n        // not be read and queried.\\n        return He(Ke(_t.fromString(`__bundle__/docs/${t}`)));\\n    }(s));\\n    // Allocates a target to hold all document keys from the bundle, such that\\n    // they will not get garbage collected right away.\\n        return i.persistence.runTransaction(\\\"Apply bundle documents\\\", \\\"readwrite\\\", (t => uo(t, u, o).next((e => (u.apply(t), \\n    e))).next((e => i.fs.removeMatchingKeysForTargetId(t, a.targetId).next((() => i.fs.addMatchingKeys(t, r, a.targetId))).next((() => i.fi.Gs(t, e))).next((() => e))))));\\n}\\n\\n/**\\n * Returns a promise of a boolean to indicate if the given bundle has already\\n * been loaded and the create time is newer than the current loading bundle.\\n */\\n/**\\n * Saves the given `NamedQuery` to local persistence.\\n */\\nasync function go(t, e, n = Yn()) {\\n    // Allocate a target for the named query such that it can be resumed\\n    // from associated read time if users use it to listen.\\n    // NOTE: this also means if no corresponding target exists, the new target\\n    // will remain active and will not get collected, unless users happen to\\n    // unlisten the query somehow.\\n    const s = await co(t, He(Ki(e.bundledQuery))), i = K(t);\\n    return i.persistence.runTransaction(\\\"Save named query\\\", \\\"readwrite\\\", (t => {\\n        const r = ws(e.readTime);\\n        // Simply save the query itself if it is older than what the SDK already\\n        // has.\\n                if (s.snapshotVersion.compareTo(r) >= 0) return i._s.saveNamedQuery(t, e);\\n        // Update existing target data because the query from the bundle is newer.\\n                const o = s.withResumeToken(pt.EMPTY_BYTE_STRING, r);\\n        return i.ui = i.ui.insert(o.targetId, o), i.fs.updateTargetData(t, o).next((() => i.fs.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.fs.addMatchingKeys(t, n, s.targetId))).next((() => i._s.saveNamedQuery(t, e)));\\n    }));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class yo {\\n    constructor(t) {\\n        this.M = t, this.yi = new Map, this.pi = new Map;\\n    }\\n    getBundleMetadata(t, e) {\\n        return yi.resolve(this.yi.get(e));\\n    }\\n    saveBundleMetadata(t, e) {\\n        /** Decodes a BundleMetadata proto into a BundleMetadata object. */\\n        var n;\\n        return this.yi.set(e.id, {\\n            id: (n = e).id,\\n            version: n.version,\\n            createTime: ws(n.createTime)\\n        }), yi.resolve();\\n    }\\n    getNamedQuery(t, e) {\\n        return yi.resolve(this.pi.get(e));\\n    }\\n    saveNamedQuery(t, e) {\\n        return this.pi.set(e.name, function(t) {\\n            return {\\n                name: t.name,\\n                query: Ki(t.bundledQuery),\\n                readTime: ws(t.readTime)\\n            };\\n        }(e)), yi.resolve();\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An in-memory implementation of DocumentOverlayCache.\\n */ class po {\\n    constructor() {\\n        // A map sorted by DocumentKey, whose value is a pair of the largest batch id\\n        // for the overlay and the overlay itself.\\n        this.overlays = new fe(xt.comparator), this.Ii = new Map;\\n    }\\n    getOverlay(t, e) {\\n        return yi.resolve(this.overlays.get(e));\\n    }\\n    saveOverlays(t, e, n) {\\n        return n.forEach(((n, s) => {\\n            this.Xt(t, e, s);\\n        })), yi.resolve();\\n    }\\n    removeOverlaysForBatchId(t, e, n) {\\n        const s = this.Ii.get(n);\\n        return void 0 !== s && (s.forEach((t => this.overlays = this.overlays.remove(t))), \\n        this.Ii.delete(n)), yi.resolve();\\n    }\\n    getOverlaysForCollection(t, e, n) {\\n        const s = zn(), i = e.length + 1, r = new xt(e.child(\\\"\\\")), o = this.overlays.getIteratorFrom(r);\\n        for (;o.hasNext(); ) {\\n            const t = o.getNext().value, r = t.getKey();\\n            if (!e.isPrefixOf(r.path)) break;\\n            // Documents from sub-collections\\n                        r.path.length === i && (t.largestBatchId > n && s.set(t.getKey(), t));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getOverlaysForCollectionGroup(t, e, n, s) {\\n        let i = new fe(((t, e) => t - e));\\n        const r = this.overlays.getIterator();\\n        for (;r.hasNext(); ) {\\n            const t = r.getNext().value;\\n            if (t.getKey().getCollectionGroup() === e && t.largestBatchId > n) {\\n                let e = i.get(t.largestBatchId);\\n                null === e && (e = zn(), i = i.insert(t.largestBatchId, e)), e.set(t.getKey(), t);\\n            }\\n        }\\n        const o = zn(), u = i.getIterator();\\n        for (;u.hasNext(); ) {\\n            if (u.getNext().value.forEach(((t, e) => o.set(t, e))), o.size() >= s) break;\\n        }\\n        return yi.resolve(o);\\n    }\\n    Xt(t, e, n) {\\n        if (null === n) return;\\n        // Remove the association of the overlay to its batch id.\\n                const s = this.overlays.get(n.key);\\n        if (null !== s) {\\n            const t = this.Ii.get(s.largestBatchId).delete(n.key);\\n            this.Ii.set(s.largestBatchId, t);\\n        }\\n        this.overlays = this.overlays.insert(n.key, new xi(e, n));\\n        // Create the association of this overlay to the given largestBatchId.\\n        let i = this.Ii.get(e);\\n        void 0 === i && (i = Yn(), this.Ii.set(e, i)), this.Ii.set(e, i.add(n.key));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A collection of references to a document from some kind of numbered entity\\n * (either a target ID or batch ID). As references are added to or removed from\\n * the set corresponding events are emitted to a registered garbage collector.\\n *\\n * Each reference is represented by a DocumentReference object. Each of them\\n * contains enough information to uniquely identify the reference. They are all\\n * stored primarily in a set sorted by key. A document is considered garbage if\\n * there's no references in that set (this can be efficiently checked thanks to\\n * sorting by key).\\n *\\n * ReferenceSet also keeps a secondary set that contains references sorted by\\n * IDs. This one is used to efficiently implement removal of all references by\\n * some target ID.\\n */ class Io {\\n    constructor() {\\n        // A set of outstanding references to a document sorted by key.\\n        this.Ti = new we(To.Ei), \\n        // A set of outstanding references to a document sorted by target id.\\n        this.Ai = new we(To.Ri);\\n    }\\n    /** Returns true if the reference set contains no references. */    isEmpty() {\\n        return this.Ti.isEmpty();\\n    }\\n    /** Adds a reference to the given document key for the given ID. */    addReference(t, e) {\\n        const n = new To(t, e);\\n        this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);\\n    }\\n    /** Add references to the given document keys for the given ID. */    bi(t, e) {\\n        t.forEach((t => this.addReference(t, e)));\\n    }\\n    /**\\n     * Removes a reference to the given document key for the given\\n     * ID.\\n     */    removeReference(t, e) {\\n        this.Pi(new To(t, e));\\n    }\\n    Vi(t, e) {\\n        t.forEach((t => this.removeReference(t, e)));\\n    }\\n    /**\\n     * Clears all references with a given ID. Calls removeRef() for each key\\n     * removed.\\n     */    vi(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            this.Pi(t), i.push(t.key);\\n        })), i;\\n    }\\n    Si() {\\n        this.Ti.forEach((t => this.Pi(t)));\\n    }\\n    Pi(t) {\\n        this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);\\n    }\\n    Di(t) {\\n        const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1);\\n        let i = Yn();\\n        return this.Ai.forEachInRange([ n, s ], (t => {\\n            i = i.add(t.key);\\n        })), i;\\n    }\\n    containsKey(t) {\\n        const e = new To(t, 0), n = this.Ti.firstAfterOrEqual(e);\\n        return null !== n && t.isEqual(n.key);\\n    }\\n}\\n\\nclass To {\\n    constructor(t, e) {\\n        this.key = t, this.Ci = e;\\n    }\\n    /** Compare by key then by ID */    static Ei(t, e) {\\n        return xt.comparator(t.key, e.key) || rt(t.Ci, e.Ci);\\n    }\\n    /** Compare by ID then by key */    static Ri(t, e) {\\n        return rt(t.Ci, e.Ci) || xt.comparator(t.key, e.key);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Eo {\\n    constructor(t, e) {\\n        this.indexManager = t, this.referenceDelegate = e, \\n        /**\\n         * The set of all mutations that have been sent but not yet been applied to\\n         * the backend.\\n         */\\n        this.Bs = [], \\n        /** Next value to use when assigning sequential IDs to each mutation batch. */\\n        this.xi = 1, \\n        /** An ordered mapping between documents and the mutations batch IDs. */\\n        this.Ni = new we(To.Ei);\\n    }\\n    checkEmpty(t) {\\n        return yi.resolve(0 === this.Bs.length);\\n    }\\n    addMutationBatch(t, e, n, s) {\\n        const i = this.xi;\\n        this.xi++, this.Bs.length > 0 && this.Bs[this.Bs.length - 1];\\n        const r = new Di(i, e, n, s);\\n        this.Bs.push(r);\\n        // Track references by document key and index collection parents.\\n        for (const e of s) this.Ni = this.Ni.add(new To(e.key, i)), this.indexManager.addToCollectionParentIndex(t, e.key.path.popLast());\\n        return yi.resolve(r);\\n    }\\n    lookupMutationBatch(t, e) {\\n        return yi.resolve(this.ki(e));\\n    }\\n    getNextMutationBatchAfterBatchId(t, e) {\\n        const n = e + 1, s = this.Mi(n), i = s < 0 ? 0 : s;\\n        // The requested batchId may still be out of range so normalize it to the\\n        // start of the queue.\\n                return yi.resolve(this.Bs.length > i ? this.Bs[i] : null);\\n    }\\n    getHighestUnacknowledgedBatchId() {\\n        return yi.resolve(0 === this.Bs.length ? -1 : this.xi - 1);\\n    }\\n    getAllMutationBatches(t) {\\n        return yi.resolve(this.Bs.slice());\\n    }\\n    getAllMutationBatchesAffectingDocumentKey(t, e) {\\n        const n = new To(e, 0), s = new To(e, Number.POSITIVE_INFINITY), i = [];\\n        return this.Ni.forEachInRange([ n, s ], (t => {\\n            const e = this.ki(t.Ci);\\n            i.push(e);\\n        })), yi.resolve(i);\\n    }\\n    getAllMutationBatchesAffectingDocumentKeys(t, e) {\\n        let n = new we(rt);\\n        return e.forEach((t => {\\n            const e = new To(t, 0), s = new To(t, Number.POSITIVE_INFINITY);\\n            this.Ni.forEachInRange([ e, s ], (t => {\\n                n = n.add(t.Ci);\\n            }));\\n        })), yi.resolve(this.Oi(n));\\n    }\\n    getAllMutationBatchesAffectingQuery(t, e) {\\n        // Use the query path as a prefix for testing if a document matches the\\n        // query.\\n        const n = e.path, s = n.length + 1;\\n        // Construct a document reference for actually scanning the index. Unlike\\n        // the prefix the document key in this reference must have an even number of\\n        // segments. The empty segment can be used a suffix of the query path\\n        // because it precedes all other segments in an ordered traversal.\\n        let i = n;\\n        xt.isDocumentKey(i) || (i = i.child(\\\"\\\"));\\n        const r = new To(new xt(i), 0);\\n        // Find unique batchIDs referenced by all documents potentially matching the\\n        // query.\\n                let o = new we(rt);\\n        return this.Ni.forEachWhile((t => {\\n            const e = t.key.path;\\n            return !!n.isPrefixOf(e) && (\\n            // Rows with document keys more than one segment longer than the query\\n            // path can't be matches. For example, a query on 'rooms' can't match\\n            // the document /rooms/abc/messages/xyx.\\n            // TODO(mcg): we'll need a different scanner when we implement\\n            // ancestor queries.\\n            e.length === s && (o = o.add(t.Ci)), !0);\\n        }), r), yi.resolve(this.Oi(o));\\n    }\\n    Oi(t) {\\n        // Construct an array of matching batches, sorted by batchID to ensure that\\n        // multiple mutations affecting the same document key are applied in order.\\n        const e = [];\\n        return t.forEach((t => {\\n            const n = this.ki(t);\\n            null !== n && e.push(n);\\n        })), e;\\n    }\\n    removeMutationBatch(t, e) {\\n        U(0 === this.Fi(e.batchId, \\\"removed\\\")), this.Bs.shift();\\n        let n = this.Ni;\\n        return yi.forEach(e.mutations, (s => {\\n            const i = new To(s.key, e.batchId);\\n            return n = n.delete(i), this.referenceDelegate.markPotentiallyOrphaned(t, s.key);\\n        })).next((() => {\\n            this.Ni = n;\\n        }));\\n    }\\n    _n(t) {\\n        // No-op since the memory mutation queue does not maintain a separate cache.\\n    }\\n    containsKey(t, e) {\\n        const n = new To(e, 0), s = this.Ni.firstAfterOrEqual(n);\\n        return yi.resolve(e.isEqual(s && s.key));\\n    }\\n    performConsistencyCheck(t) {\\n        return this.Bs.length, yi.resolve();\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue and asserts that\\n     * the resulting index is within the bounds of the queue.\\n     *\\n     * @param batchId - The batchId to search for\\n     * @param action - A description of what the caller is doing, phrased in passive\\n     * form (e.g. \\\"acknowledged\\\" in a routine that acknowledges batches).\\n     */    Fi(t, e) {\\n        return this.Mi(t);\\n    }\\n    /**\\n     * Finds the index of the given batchId in the mutation queue. This operation\\n     * is O(1).\\n     *\\n     * @returns The computed index of the batch with the given batchId, based on\\n     * the state of the queue. Note this index can be negative if the requested\\n     * batchId has already been remvoed from the queue or past the end of the\\n     * queue if the batchId is larger than the last added batch.\\n     */    Mi(t) {\\n        if (0 === this.Bs.length) \\n        // As an index this is past the end of the queue\\n        return 0;\\n        // Examine the front of the queue to figure out the difference between the\\n        // batchId and indexes in the array. Note that since the queue is ordered\\n        // by batchId, if the first batch has a larger batchId then the requested\\n        // batchId doesn't exist in the queue.\\n                return t - this.Bs[0].batchId;\\n    }\\n    /**\\n     * A version of lookupMutationBatch that doesn't return a promise, this makes\\n     * other functions that uses this code easier to read and more efficent.\\n     */    ki(t) {\\n        const e = this.Mi(t);\\n        if (e < 0 || e >= this.Bs.length) return null;\\n        return this.Bs[e];\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\\n * `newMemoryRemoteDocumentCache()`.\\n */\\nclass Ao {\\n    /**\\n     * @param sizer - Used to assess the size of a document. For eager GC, this is\\n     * expected to just return 0 to avoid unnecessarily doing the work of\\n     * calculating the size.\\n     */\\n    constructor(t) {\\n        this.$i = t, \\n        /** Underlying cache of documents and their read times. */\\n        this.docs = new fe(xt.comparator), \\n        /** Size of all cached documents. */\\n        this.size = 0;\\n    }\\n    setIndexManager(t) {\\n        this.indexManager = t;\\n    }\\n    /**\\n     * Adds the supplied entry to the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    addEntry(t, e) {\\n        const n = e.key, s = this.docs.get(n), i = s ? s.size : 0, r = this.$i(e);\\n        return this.docs = this.docs.insert(n, {\\n            document: e.mutableCopy(),\\n            size: r\\n        }), this.size += r - i, this.indexManager.addToCollectionParentIndex(t, n.path.popLast());\\n    }\\n    /**\\n     * Removes the specified entry from the cache and updates the cache size as appropriate.\\n     *\\n     * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\\n     * returned by `newChangeBuffer()`.\\n     */    removeEntry(t) {\\n        const e = this.docs.get(t);\\n        e && (this.docs = this.docs.remove(t), this.size -= e.size);\\n    }\\n    getEntry(t, e) {\\n        const n = this.docs.get(e);\\n        return yi.resolve(n ? n.document.mutableCopy() : ne.newInvalidDocument(e));\\n    }\\n    getEntries(t, e) {\\n        let n = Qn();\\n        return e.forEach((t => {\\n            const e = this.docs.get(t);\\n            n = n.insert(t, e ? e.document.mutableCopy() : ne.newInvalidDocument(t));\\n        })), yi.resolve(n);\\n    }\\n    getAllFromCollection(t, e, n) {\\n        let s = Qn();\\n        // Documents are ordered by key, so we can use a prefix scan to narrow down\\n        // the documents we need to match the query against.\\n                const i = new xt(e.child(\\\"\\\")), r = this.docs.getIteratorFrom(i);\\n        for (;r.hasNext(); ) {\\n            const {key: t, value: {document: i}} = r.getNext();\\n            if (!e.isPrefixOf(t.path)) break;\\n            t.path.length > e.length + 1 || (le(ce(i), n) <= 0 || (s = s.insert(i.key, i.mutableCopy())));\\n        }\\n        return yi.resolve(s);\\n    }\\n    getAllFromCollectionGroup(t, e, n, s) {\\n        // This method should only be called from the IndexBackfiller if persistence\\n        // is enabled.\\n        L();\\n    }\\n    Bi(t, e) {\\n        return yi.forEach(this.docs, (t => e(t)));\\n    }\\n    newChangeBuffer(t) {\\n        // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\\n        // a separate changelog and does not need special handling for removals.\\n        return new Ro(this);\\n    }\\n    getSize(t) {\\n        return yi.resolve(this.size);\\n    }\\n}\\n\\n/**\\n * Creates a new memory-only RemoteDocumentCache.\\n *\\n * @param sizer - Used to assess the size of a document. For eager GC, this is\\n * expected to just return 0 to avoid unnecessarily doing the work of\\n * calculating the size.\\n */\\n/**\\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\\n */\\nclass Ro extends Fr {\\n    constructor(t) {\\n        super(), this.Kn = t;\\n    }\\n    applyChanges(t) {\\n        const e = [];\\n        return this.changes.forEach(((n, s) => {\\n            s.isValidDocument() ? e.push(this.Kn.addEntry(t, s)) : this.Kn.removeEntry(n);\\n        })), yi.waitFor(e);\\n    }\\n    getFromCache(t, e) {\\n        return this.Kn.getEntry(t, e);\\n    }\\n    getAllFromCache(t, e) {\\n        return this.Kn.getEntries(t, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class bo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /**\\n         * Maps a target to the data about that target\\n         */\\n        this.Li = new Kn((t => Ie(t)), Ee), \\n        /** The last received snapshot version. */\\n        this.lastRemoteSnapshotVersion = ct.min(), \\n        /** The highest numbered target ID encountered. */\\n        this.highestTargetId = 0, \\n        /** The highest sequence number encountered. */\\n        this.Ui = 0, \\n        /**\\n         * A ordered bidirectional mapping between documents and the remote target\\n         * IDs.\\n         */\\n        this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();\\n    }\\n    forEachTarget(t, e) {\\n        return this.Li.forEach(((t, n) => e(n))), yi.resolve();\\n    }\\n    getLastRemoteSnapshotVersion(t) {\\n        return yi.resolve(this.lastRemoteSnapshotVersion);\\n    }\\n    getHighestSequenceNumber(t) {\\n        return yi.resolve(this.Ui);\\n    }\\n    allocateTargetId(t) {\\n        return this.highestTargetId = this.Ki.next(), yi.resolve(this.highestTargetId);\\n    }\\n    setTargetsMetadata(t, e, n) {\\n        return n && (this.lastRemoteSnapshotVersion = n), e > this.Ui && (this.Ui = e), \\n        yi.resolve();\\n    }\\n    Tn(t) {\\n        this.Li.set(t.target, t);\\n        const e = t.targetId;\\n        e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);\\n    }\\n    addTargetData(t, e) {\\n        return this.Tn(e), this.targetCount += 1, yi.resolve();\\n    }\\n    updateTargetData(t, e) {\\n        return this.Tn(e), yi.resolve();\\n    }\\n    removeTargetData(t, e) {\\n        return this.Li.delete(e.target), this.qi.vi(e.targetId), this.targetCount -= 1, \\n        yi.resolve();\\n    }\\n    removeTargets(t, e, n) {\\n        let s = 0;\\n        const i = [];\\n        return this.Li.forEach(((r, o) => {\\n            o.sequenceNumber <= e && null === n.get(o.targetId) && (this.Li.delete(r), i.push(this.removeMatchingKeysForTargetId(t, o.targetId)), \\n            s++);\\n        })), yi.waitFor(i).next((() => s));\\n    }\\n    getTargetCount(t) {\\n        return yi.resolve(this.targetCount);\\n    }\\n    getTargetData(t, e) {\\n        const n = this.Li.get(e) || null;\\n        return yi.resolve(n);\\n    }\\n    addMatchingKeys(t, e, n) {\\n        return this.qi.bi(e, n), yi.resolve();\\n    }\\n    removeMatchingKeys(t, e, n) {\\n        this.qi.Vi(e, n);\\n        const s = this.persistence.referenceDelegate, i = [];\\n        return s && e.forEach((e => {\\n            i.push(s.markPotentiallyOrphaned(t, e));\\n        })), yi.waitFor(i);\\n    }\\n    removeMatchingKeysForTargetId(t, e) {\\n        return this.qi.vi(e), yi.resolve();\\n    }\\n    getMatchingKeysForTargetId(t, e) {\\n        const n = this.qi.Di(e);\\n        return yi.resolve(n);\\n    }\\n    containsKey(t, e) {\\n        return yi.resolve(this.qi.containsKey(e));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A memory-backed instance of Persistence. Data is stored only in RAM and\\n * not persisted across sessions.\\n */\\nclass Po {\\n    /**\\n     * The constructor accepts a factory for creating a reference delegate. This\\n     * allows both the delegate and this instance to have strong references to\\n     * each other without having nullable fields that would then need to be\\n     * checked or asserted on every access.\\n     */\\n    constructor(t, e) {\\n        this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0, \\n        this.referenceDelegate = t(this), this.fs = new bo(this);\\n        this.indexManager = new ar, this.ds = function(t) {\\n            return new Ao(t);\\n        }((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);\\n    }\\n    start() {\\n        return Promise.resolve();\\n    }\\n    shutdown() {\\n        // No durable state to ensure is closed on shutdown.\\n        return this.ns = !1, Promise.resolve();\\n    }\\n    get started() {\\n        return this.ns;\\n    }\\n    setDatabaseDeletedListener() {\\n        // No op.\\n    }\\n    setNetworkEnabled() {\\n        // No op.\\n    }\\n    getIndexManager(t) {\\n        // We do not currently support indices for memory persistence, so we can\\n        // return the same shared instance of the memory index manager.\\n        return this.indexManager;\\n    }\\n    getDocumentOverlayCache(t) {\\n        let e = this.overlays[t.toKey()];\\n        return e || (e = new po, this.overlays[t.toKey()] = e), e;\\n    }\\n    getMutationQueue(t, e) {\\n        let n = this.Gi[t.toKey()];\\n        return n || (n = new Eo(e, this.referenceDelegate), this.Gi[t.toKey()] = n), n;\\n    }\\n    getTargetCache() {\\n        return this.fs;\\n    }\\n    getRemoteDocumentCache() {\\n        return this.ds;\\n    }\\n    getBundleCache() {\\n        return this._s;\\n    }\\n    runTransaction(t, e, n) {\\n        O(\\\"MemoryPersistence\\\", \\\"Starting transaction:\\\", t);\\n        const s = new Vo(this.es.next());\\n        return this.referenceDelegate.ji(), n(s).next((t => this.referenceDelegate.Wi(s).next((() => t)))).toPromise().then((t => (s.raiseOnCommittedEvent(), \\n        t)));\\n    }\\n    zi(t, e) {\\n        return yi.or(Object.values(this.Gi).map((n => () => n.containsKey(t, e))));\\n    }\\n}\\n\\n/**\\n * Memory persistence is not actually transactional, but future implementations\\n * may have transaction-scoped state.\\n */ class Vo extends gi {\\n    constructor(t) {\\n        super(), this.currentSequenceNumber = t;\\n    }\\n}\\n\\nclass vo {\\n    constructor(t) {\\n        this.persistence = t, \\n        /** Tracks all documents that are active in Query views. */\\n        this.Hi = new Io, \\n        /** The list of documents that are potentially GCed after each transaction. */\\n        this.Ji = null;\\n    }\\n    static Yi(t) {\\n        return new vo(t);\\n    }\\n    get Xi() {\\n        if (this.Ji) return this.Ji;\\n        throw L();\\n    }\\n    addReference(t, e, n) {\\n        return this.Hi.addReference(n, e), this.Xi.delete(n.toString()), yi.resolve();\\n    }\\n    removeReference(t, e, n) {\\n        return this.Hi.removeReference(n, e), this.Xi.add(n.toString()), yi.resolve();\\n    }\\n    markPotentiallyOrphaned(t, e) {\\n        return this.Xi.add(e.toString()), yi.resolve();\\n    }\\n    removeTarget(t, e) {\\n        this.Hi.vi(e.targetId).forEach((t => this.Xi.add(t.toString())));\\n        const n = this.persistence.getTargetCache();\\n        return n.getMatchingKeysForTargetId(t, e.targetId).next((t => {\\n            t.forEach((t => this.Xi.add(t.toString())));\\n        })).next((() => n.removeTargetData(t, e)));\\n    }\\n    ji() {\\n        this.Ji = new Set;\\n    }\\n    Wi(t) {\\n        // Remove newly orphaned documents.\\n        const e = this.persistence.getRemoteDocumentCache().newChangeBuffer();\\n        return yi.forEach(this.Xi, (n => {\\n            const s = xt.fromPath(n);\\n            return this.Zi(t, s).next((t => {\\n                t || e.removeEntry(s, ct.min());\\n            }));\\n        })).next((() => (this.Ji = null, e.apply(t))));\\n    }\\n    updateLimboDocument(t, e) {\\n        return this.Zi(t, e).next((t => {\\n            t ? this.Xi.delete(e.toString()) : this.Xi.add(e.toString());\\n        }));\\n    }\\n    Qi(t) {\\n        // For eager GC, we don't care about the document size, there are no size thresholds.\\n        return 0;\\n    }\\n    Zi(t, e) {\\n        return yi.or([ () => yi.resolve(this.Hi.containsKey(e)), () => this.persistence.getTargetCache().containsKey(t, e), () => this.persistence.zi(t, e) ]);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// The format of the LocalStorage key that stores the client state is:\\n//     firestore_clients_<persistence_prefix>_<instance_key>\\n/** Assembles the key for a client state in WebStorage */\\nfunction So(t, e) {\\n    return `firestore_clients_${t}_${e}`;\\n}\\n\\n// The format of the WebStorage key that stores the mutation state is:\\n//     firestore_mutations_<persistence_prefix>_<batch_id>\\n//     (for unauthenticated users)\\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\\n\\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\\n// contain.\\n/** Assembles the key for a mutation batch in WebStorage */\\nfunction Do(t, e, n) {\\n    let s = `firestore_mutations_${t}_${n}`;\\n    return e.isAuthenticated() && (s += `_${e.uid}`), s;\\n}\\n\\n// The format of the WebStorage key that stores a query target's metadata is:\\n//     firestore_targets_<persistence_prefix>_<target_id>\\n/** Assembles the key for a query state in WebStorage */\\nfunction Co(t, e) {\\n    return `firestore_targets_${t}_${e}`;\\n}\\n\\n// The WebStorage prefix that stores the primary tab's online state. The\\n// format of the key is:\\n//     firestore_online_state_<persistence_prefix>\\n/**\\n * Holds the state of a mutation batch, including its user ID, batch ID and\\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\\n */\\n// Visible for testing\\nclass xo {\\n    constructor(t, e, n, s) {\\n        this.user = t, this.batchId = e, this.state = n, this.error = s;\\n    }\\n    /**\\n     * Parses a MutationMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e, n) {\\n        const s = JSON.parse(n);\\n        let i, r = \\\"object\\\" == typeof s && -1 !== [ \\\"pending\\\", \\\"acknowledged\\\", \\\"rejected\\\" ].indexOf(s.state) && (void 0 === s.error || \\\"object\\\" == typeof s.error);\\n        return r && s.error && (r = \\\"string\\\" == typeof s.error.message && \\\"string\\\" == typeof s.error.code, \\n        r && (i = new Q(s.error.code, s.error.message))), r ? new xo(t, e, s.state, i) : (F(\\\"SharedClientState\\\", `Failed to parse mutation state for ID '${e}': ${n}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * Holds the state of a query target, including its target ID and whether the\\n * target is 'not-current', 'current' or 'rejected'.\\n */\\n// Visible for testing\\nclass No {\\n    constructor(t, e, n) {\\n        this.targetId = t, this.state = e, this.error = n;\\n    }\\n    /**\\n     * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s, i = \\\"object\\\" == typeof n && -1 !== [ \\\"not-current\\\", \\\"current\\\", \\\"rejected\\\" ].indexOf(n.state) && (void 0 === n.error || \\\"object\\\" == typeof n.error);\\n        return i && n.error && (i = \\\"string\\\" == typeof n.error.message && \\\"string\\\" == typeof n.error.code, \\n        i && (s = new Q(n.error.code, n.error.message))), i ? new No(t, n.state, s) : (F(\\\"SharedClientState\\\", `Failed to parse target state for ID '${t}': ${e}`), \\n        null);\\n    }\\n    er() {\\n        const t = {\\n            state: this.state,\\n            updateTimeMs: Date.now()\\n        };\\n        return this.error && (t.error = {\\n            code: this.error.code,\\n            message: this.error.message\\n        }), JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * This class represents the immutable ClientState for a client read from\\n * WebStorage, containing the list of active query targets.\\n */ class ko {\\n    constructor(t, e) {\\n        this.clientId = t, this.activeTargetIds = e;\\n    }\\n    /**\\n     * Parses a RemoteClientState from the JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t, e) {\\n        const n = JSON.parse(e);\\n        let s = \\\"object\\\" == typeof n && n.activeTargetIds instanceof Array, i = Zn();\\n        for (let t = 0; s && t < n.activeTargetIds.length; ++t) s = Ct(n.activeTargetIds[t]), \\n        i = i.add(n.activeTargetIds[t]);\\n        return s ? new ko(t, i) : (F(\\\"SharedClientState\\\", `Failed to parse client data for instance '${t}': ${e}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * This class represents the online state for all clients participating in\\n * multi-tab. The online state is only written to by the primary client, and\\n * used in secondary clients to update their query views.\\n */ class Mo {\\n    constructor(t, e) {\\n        this.clientId = t, this.onlineState = e;\\n    }\\n    /**\\n     * Parses a SharedOnlineState from its JSON representation in WebStorage.\\n     * Logs a warning and returns null if the format of the data is not valid.\\n     */    static tr(t) {\\n        const e = JSON.parse(t);\\n        return \\\"object\\\" == typeof e && -1 !== [ \\\"Unknown\\\", \\\"Online\\\", \\\"Offline\\\" ].indexOf(e.onlineState) && \\\"string\\\" == typeof e.clientId ? new Mo(e.clientId, e.onlineState) : (F(\\\"SharedClientState\\\", `Failed to parse online state: ${t}`), \\n        null);\\n    }\\n}\\n\\n/**\\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\\n * mutable and keeps track of all pending mutations, which allows us to\\n * update the range of pending mutation batch IDs as new mutations are added or\\n * removed.\\n *\\n * The data in `LocalClientState` is not read from WebStorage and instead\\n * updated via its instance methods. The updated state can be serialized via\\n * `toWebStorageJSON()`.\\n */\\n// Visible for testing.\\nclass Oo {\\n    constructor() {\\n        this.activeTargetIds = Zn();\\n    }\\n    nr(t) {\\n        this.activeTargetIds = this.activeTargetIds.add(t);\\n    }\\n    sr(t) {\\n        this.activeTargetIds = this.activeTargetIds.delete(t);\\n    }\\n    /**\\n     * Converts this entry into a JSON-encoded format we can use for WebStorage.\\n     * Does not encode `clientId` as it is part of the key in WebStorage.\\n     */    er() {\\n        const t = {\\n            activeTargetIds: this.activeTargetIds.toArray(),\\n            updateTimeMs: Date.now()\\n        };\\n        return JSON.stringify(t);\\n    }\\n}\\n\\n/**\\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\\n * backing store for the SharedClientState. It keeps track of all active\\n * clients and supports modifications of the local client's data.\\n */ class Fo {\\n    constructor(t, e, n, s, i) {\\n        this.window = t, this.Yn = e, this.persistenceKey = n, this.ir = s, this.syncEngine = null, \\n        this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.rr = this.ur.bind(this), \\n        this.ar = new fe(rt), this.started = !1, \\n        /**\\n         * Captures WebStorage events that occur before `start()` is called. These\\n         * events are replayed once `WebStorageSharedClientState` is started.\\n         */\\n        this.cr = [];\\n        // Escape the special characters mentioned here:\\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\\n        const r = n.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g, \\\"\\\\\\\\$&\\\");\\n        this.storage = this.window.localStorage, this.currentUser = i, this.hr = So(this.persistenceKey, this.ir), \\n        this.lr = \\n        /** Assembles the key for the current sequence number. */\\n        function(t) {\\n            return `firestore_sequence_number_${t}`;\\n        }\\n        /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (this.persistenceKey), this.ar = this.ar.insert(this.ir, new Oo), this.dr = new RegExp(`^firestore_clients_${r}_([^_]*)$`), \\n        this._r = new RegExp(`^firestore_mutations_${r}_(\\\\\\\\d+)(?:_(.*))?$`), this.wr = new RegExp(`^firestore_targets_${r}_(\\\\\\\\d+)$`), \\n        this.mr = \\n        /** Assembles the key for the online state of the primary tab. */\\n        function(t) {\\n            return `firestore_online_state_${t}`;\\n        }\\n        // The WebStorage prefix that plays as a event to indicate the remote documents\\n        // might have changed due to some secondary tabs loading a bundle.\\n        // format of the key is:\\n        //     firestore_bundle_loaded_v2_<persistenceKey>\\n        // The version ending with \\\"v2\\\" stores the list of modified collection groups.\\n        (this.persistenceKey), this.gr = function(t) {\\n            return `firestore_bundle_loaded_v2_${t}`;\\n        }\\n        // The WebStorage key prefix for the key that stores the last sequence number allocated. The key\\n        // looks like 'firestore_sequence_number_<persistence_prefix>'.\\n        (this.persistenceKey), \\n        // Rather than adding the storage observer during start(), we add the\\n        // storage observer during initialization. This ensures that we collect\\n        // events before other components populate their initial state (during their\\n        // respective start() calls). Otherwise, we might for example miss a\\n        // mutation that is added after LocalStore's start() processed the existing\\n        // mutations but before we observe WebStorage events.\\n        this.window.addEventListener(\\\"storage\\\", this.rr);\\n    }\\n    /** Returns 'true' if WebStorage is available in the current environment. */    static vt(t) {\\n        return !(!t || !t.localStorage);\\n    }\\n    async start() {\\n        // Retrieve the list of existing clients to backfill the data in\\n        // SharedClientState.\\n        const t = await this.syncEngine.Fs();\\n        for (const e of t) {\\n            if (e === this.ir) continue;\\n            const t = this.getItem(So(this.persistenceKey, e));\\n            if (t) {\\n                const n = ko.tr(e, t);\\n                n && (this.ar = this.ar.insert(n.clientId, n));\\n            }\\n        }\\n        this.yr();\\n        // Check if there is an existing online state and call the callback handler\\n        // if applicable.\\n        const e = this.storage.getItem(this.mr);\\n        if (e) {\\n            const t = this.pr(e);\\n            t && this.Ir(t);\\n        }\\n        for (const t of this.cr) this.ur(t);\\n        this.cr = [], \\n        // Register a window unload hook to remove the client metadata entry from\\n        // WebStorage even if `shutdown()` was not called.\\n        this.window.addEventListener(\\\"pagehide\\\", (() => this.shutdown())), this.started = !0;\\n    }\\n    writeSequenceNumber(t) {\\n        this.setItem(this.lr, JSON.stringify(t));\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Tr(this.ar);\\n    }\\n    isActiveQueryTarget(t) {\\n        let e = !1;\\n        return this.ar.forEach(((n, s) => {\\n            s.activeTargetIds.has(t) && (e = !0);\\n        })), e;\\n    }\\n    addPendingMutation(t) {\\n        this.Er(t, \\\"pending\\\");\\n    }\\n    updateMutationState(t, e, n) {\\n        this.Er(t, e, n), \\n        // Once a final mutation result is observed by other clients, they no longer\\n        // access the mutation's metadata entry. Since WebStorage replays events\\n        // in order, it is safe to delete the entry right after updating it.\\n        this.Ar(t);\\n    }\\n    addLocalQueryTarget(t) {\\n        let e = \\\"not-current\\\";\\n        // Lookup an existing query state if the target ID was already registered\\n        // by another tab\\n                if (this.isActiveQueryTarget(t)) {\\n            const n = this.storage.getItem(Co(this.persistenceKey, t));\\n            if (n) {\\n                const s = No.tr(t, n);\\n                s && (e = s.state);\\n            }\\n        }\\n        return this.Rr.nr(t), this.yr(), e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Rr.sr(t), this.yr();\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Rr.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        this.removeItem(Co(this.persistenceKey, t));\\n    }\\n    updateQueryState(t, e, n) {\\n        this.br(t, e, n);\\n    }\\n    handleUserChange(t, e, n) {\\n        e.forEach((t => {\\n            this.Ar(t);\\n        })), this.currentUser = t, n.forEach((t => {\\n            this.addPendingMutation(t);\\n        }));\\n    }\\n    setOnlineState(t) {\\n        this.Pr(t);\\n    }\\n    notifyBundleLoaded(t) {\\n        this.Vr(t);\\n    }\\n    shutdown() {\\n        this.started && (this.window.removeEventListener(\\\"storage\\\", this.rr), this.removeItem(this.hr), \\n        this.started = !1);\\n    }\\n    getItem(t) {\\n        const e = this.storage.getItem(t);\\n        return O(\\\"SharedClientState\\\", \\\"READ\\\", t, e), e;\\n    }\\n    setItem(t, e) {\\n        O(\\\"SharedClientState\\\", \\\"SET\\\", t, e), this.storage.setItem(t, e);\\n    }\\n    removeItem(t) {\\n        O(\\\"SharedClientState\\\", \\\"REMOVE\\\", t), this.storage.removeItem(t);\\n    }\\n    ur(t) {\\n        // Note: The function is typed to take Event to be interface-compatible with\\n        // `Window.addEventListener`.\\n        const e = t;\\n        if (e.storageArea === this.storage) {\\n            if (O(\\\"SharedClientState\\\", \\\"EVENT\\\", e.key, e.newValue), e.key === this.hr) return void F(\\\"Received WebStorage notification for local change. Another client might have garbage-collected our state\\\");\\n            this.Yn.enqueueRetryable((async () => {\\n                if (this.started) {\\n                    if (null !== e.key) if (this.dr.test(e.key)) {\\n                        if (null == e.newValue) {\\n                            const t = this.vr(e.key);\\n                            return this.Sr(t, null);\\n                        }\\n                        {\\n                            const t = this.Dr(e.key, e.newValue);\\n                            if (t) return this.Sr(t.clientId, t);\\n                        }\\n                    } else if (this._r.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.Cr(e.key, e.newValue);\\n                            if (t) return this.Nr(t);\\n                        }\\n                    } else if (this.wr.test(e.key)) {\\n                        if (null !== e.newValue) {\\n                            const t = this.kr(e.key, e.newValue);\\n                            if (t) return this.Mr(t);\\n                        }\\n                    } else if (e.key === this.mr) {\\n                        if (null !== e.newValue) {\\n                            const t = this.pr(e.newValue);\\n                            if (t) return this.Ir(t);\\n                        }\\n                    } else if (e.key === this.lr) {\\n                        const t = function(t) {\\n                            let e = nt.A;\\n                            if (null != t) try {\\n                                const n = JSON.parse(t);\\n                                U(\\\"number\\\" == typeof n), e = n;\\n                            } catch (t) {\\n                                F(\\\"SharedClientState\\\", \\\"Failed to read sequence number from WebStorage\\\", t);\\n                            }\\n                            return e;\\n                        }\\n                        /**\\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\\n * clients using memory persistence. The state in this class remains fully\\n * isolated and no synchronization is performed.\\n */ (e.newValue);\\n                        t !== nt.A && this.sequenceNumberHandler(t);\\n                    } else if (e.key === this.gr) {\\n                        const t = this.Or(e.newValue);\\n                        await Promise.all(t.map((t => this.syncEngine.Fr(t))));\\n                    }\\n                } else this.cr.push(e);\\n            }));\\n        }\\n    }\\n    get Rr() {\\n        return this.ar.get(this.ir);\\n    }\\n    yr() {\\n        this.setItem(this.hr, this.Rr.er());\\n    }\\n    Er(t, e, n) {\\n        const s = new xo(this.currentUser, t, e, n), i = Do(this.persistenceKey, this.currentUser, t);\\n        this.setItem(i, s.er());\\n    }\\n    Ar(t) {\\n        const e = Do(this.persistenceKey, this.currentUser, t);\\n        this.removeItem(e);\\n    }\\n    Pr(t) {\\n        const e = {\\n            clientId: this.ir,\\n            onlineState: t\\n        };\\n        this.storage.setItem(this.mr, JSON.stringify(e));\\n    }\\n    br(t, e, n) {\\n        const s = Co(this.persistenceKey, t), i = new No(t, e, n);\\n        this.setItem(s, i.er());\\n    }\\n    Vr(t) {\\n        const e = JSON.stringify(Array.from(t));\\n        this.setItem(this.gr, e);\\n    }\\n    /**\\n     * Parses a client state key in WebStorage. Returns null if the key does not\\n     * match the expected key format.\\n     */    vr(t) {\\n        const e = this.dr.exec(t);\\n        return e ? e[1] : null;\\n    }\\n    /**\\n     * Parses a client state in WebStorage. Returns 'null' if the value could not\\n     * be parsed.\\n     */    Dr(t, e) {\\n        const n = this.vr(t);\\n        return ko.tr(n, e);\\n    }\\n    /**\\n     * Parses a mutation batch state in WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    Cr(t, e) {\\n        const n = this._r.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;\\n        return xo.tr(new C(i), s, e);\\n    }\\n    /**\\n     * Parses a query target state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    kr(t, e) {\\n        const n = this.wr.exec(t), s = Number(n[1]);\\n        return No.tr(s, e);\\n    }\\n    /**\\n     * Parses an online state from WebStorage. Returns 'null' if the value\\n     * could not be parsed.\\n     */    pr(t) {\\n        return Mo.tr(t);\\n    }\\n    Or(t) {\\n        return JSON.parse(t);\\n    }\\n    async Nr(t) {\\n        if (t.user.uid === this.currentUser.uid) return this.syncEngine.$r(t.batchId, t.state, t.error);\\n        O(\\\"SharedClientState\\\", `Ignoring mutation for non-active user ${t.user.uid}`);\\n    }\\n    Mr(t) {\\n        return this.syncEngine.Br(t.targetId, t.state, t.error);\\n    }\\n    Sr(t, e) {\\n        const n = e ? this.ar.insert(t, e) : this.ar.remove(t), s = this.Tr(this.ar), i = this.Tr(n), r = [], o = [];\\n        return i.forEach((t => {\\n            s.has(t) || r.push(t);\\n        })), s.forEach((t => {\\n            i.has(t) || o.push(t);\\n        })), this.syncEngine.Lr(r, o).then((() => {\\n            this.ar = n;\\n        }));\\n    }\\n    Ir(t) {\\n        // We check whether the client that wrote this online state is still active\\n        // by comparing its client ID to the list of clients kept active in\\n        // IndexedDb. If a client does not update their IndexedDb client state\\n        // within 5 seconds, it is considered inactive and we don't emit an online\\n        // state event.\\n        this.ar.get(t.clientId) && this.onlineStateHandler(t.onlineState);\\n    }\\n    Tr(t) {\\n        let e = Zn();\\n        return t.forEach(((t, n) => {\\n            e = e.unionWith(n.activeTargetIds);\\n        })), e;\\n    }\\n}\\n\\nclass $o {\\n    constructor() {\\n        this.Ur = new Oo, this.qr = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null;\\n    }\\n    addPendingMutation(t) {\\n        // No op.\\n    }\\n    updateMutationState(t, e, n) {\\n        // No op.\\n    }\\n    addLocalQueryTarget(t) {\\n        return this.Ur.nr(t), this.qr[t] || \\\"not-current\\\";\\n    }\\n    updateQueryState(t, e, n) {\\n        this.qr[t] = e;\\n    }\\n    removeLocalQueryTarget(t) {\\n        this.Ur.sr(t);\\n    }\\n    isLocalQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    clearQueryState(t) {\\n        delete this.qr[t];\\n    }\\n    getAllActiveQueryTargets() {\\n        return this.Ur.activeTargetIds;\\n    }\\n    isActiveQueryTarget(t) {\\n        return this.Ur.activeTargetIds.has(t);\\n    }\\n    start() {\\n        return this.Ur = new Oo, Promise.resolve();\\n    }\\n    handleUserChange(t, e, n) {\\n        // No op.\\n    }\\n    setOnlineState(t) {\\n        // No op.\\n    }\\n    shutdown() {}\\n    writeSequenceNumber(t) {}\\n    notifyBundleLoaded(t) {\\n        // No op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Bo {\\n    Kr(t) {\\n        // No-op.\\n    }\\n    shutdown() {\\n        // No-op.\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\\n/* eslint-disable no-restricted-globals */\\n/**\\n * Browser implementation of ConnectivityMonitor.\\n */\\nclass Lo {\\n    constructor() {\\n        this.Gr = () => this.Qr(), this.jr = () => this.Wr(), this.zr = [], this.Hr();\\n    }\\n    Kr(t) {\\n        this.zr.push(t);\\n    }\\n    shutdown() {\\n        window.removeEventListener(\\\"online\\\", this.Gr), window.removeEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Hr() {\\n        window.addEventListener(\\\"online\\\", this.Gr), window.addEventListener(\\\"offline\\\", this.jr);\\n    }\\n    Qr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: AVAILABLE\\\");\\n        for (const t of this.zr) t(0 /* AVAILABLE */);\\n    }\\n    Wr() {\\n        O(\\\"ConnectivityMonitor\\\", \\\"Network connectivity changed: UNAVAILABLE\\\");\\n        for (const t of this.zr) t(1 /* UNAVAILABLE */);\\n    }\\n    // TODO(chenbrian): Consider passing in window either into this component or\\n    // here for testing via FakeWindow.\\n    /** Checks that all used attributes of window are available. */\\n    static vt() {\\n        return \\\"undefined\\\" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Uo = {\\n    BatchGetDocuments: \\\"batchGet\\\",\\n    Commit: \\\"commit\\\",\\n    RunQuery: \\\"runQuery\\\"\\n};\\n\\n/**\\n * Maps RPC names to the corresponding REST endpoint name.\\n *\\n * We use array notation to avoid mangling.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Provides a simple helper class that implements the Stream interface to\\n * bridge to other implementations that are streams but do not implement the\\n * interface. The stream callbacks are invoked with the callOn... methods.\\n */\\nclass qo {\\n    constructor(t) {\\n        this.Jr = t.Jr, this.Yr = t.Yr;\\n    }\\n    Xr(t) {\\n        this.Zr = t;\\n    }\\n    eo(t) {\\n        this.no = t;\\n    }\\n    onMessage(t) {\\n        this.so = t;\\n    }\\n    close() {\\n        this.Yr();\\n    }\\n    send(t) {\\n        this.Jr(t);\\n    }\\n    io() {\\n        this.Zr();\\n    }\\n    ro(t) {\\n        this.no(t);\\n    }\\n    oo(t) {\\n        this.so(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ko extends \\n/**\\n * Base class for all Rest-based connections to the backend (WebChannel and\\n * HTTP).\\n */\\nclass {\\n    constructor(t) {\\n        this.databaseInfo = t, this.databaseId = t.databaseId;\\n        const e = t.ssl ? \\\"https\\\" : \\\"http\\\";\\n        this.uo = e + \\\"://\\\" + t.host, this.ao = \\\"projects/\\\" + this.databaseId.projectId + \\\"/databases/\\\" + this.databaseId.database + \\\"/documents\\\";\\n    }\\n    co(t, e, n, s, i) {\\n        const r = this.ho(t, e);\\n        O(\\\"RestConnection\\\", \\\"Sending: \\\", r, n);\\n        const o = {};\\n        return this.lo(o, s, i), this.fo(t, r, o, n).then((t => (O(\\\"RestConnection\\\", \\\"Received: \\\", t), \\n        t)), (e => {\\n            throw $(\\\"RestConnection\\\", `${t} failed with error: `, e, \\\"url: \\\", r, \\\"request:\\\", n), \\n            e;\\n        }));\\n    }\\n    _o(t, e, n, s, i) {\\n        // The REST API automatically aggregates all of the streamed results, so we\\n        // can just use the normal invoke() method.\\n        return this.co(t, e, n, s, i);\\n    }\\n    /**\\n     * Modifies the headers for a request, adding any authorization token if\\n     * present and any additional headers for the request.\\n     */    lo(t, e, n) {\\n        t[\\\"X-Goog-Api-Client\\\"] = \\\"gl-js/ fire/\\\" + x, \\n        // Content-Type: text/plain will avoid preflight requests which might\\n        // mess with CORS and redirects by proxies. If we add custom headers\\n        // we will need to change this code to potentially use the $httpOverwrite\\n        // parameter supported by ESF to avoid triggering preflight requests.\\n        t[\\\"Content-Type\\\"] = \\\"text/plain\\\", this.databaseInfo.appId && (t[\\\"X-Firebase-GMPID\\\"] = this.databaseInfo.appId), \\n        e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));\\n    }\\n    ho(t, e) {\\n        const n = Uo[t];\\n        return `${this.uo}/v1/${e}:${n}`;\\n    }\\n} {\\n    constructor(t) {\\n        super(t), this.forceLongPolling = t.forceLongPolling, this.autoDetectLongPolling = t.autoDetectLongPolling, \\n        this.useFetchStreams = t.useFetchStreams;\\n    }\\n    fo(t, e, n, s) {\\n        return new Promise(((i, r) => {\\n            const o = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.XhrIo;\\n            o.listenOnce(_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.EventType.COMPLETE, (() => {\\n                try {\\n                    switch (o.getLastErrorCode()) {\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.NO_ERROR:\\n                        const e = o.getResponseJson();\\n                        O(\\\"Connection\\\", \\\"XHR received:\\\", JSON.stringify(e)), i(e);\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.TIMEOUT:\\n                        O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" timed out'), r(new Q(G.DEADLINE_EXCEEDED, \\\"Request time out\\\"));\\n                        break;\\n\\n                      case _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.ErrorCode.HTTP_ERROR:\\n                        const n = o.getStatus();\\n                        if (O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" failed with status:', n, \\\"response text:\\\", o.getResponseText()), \\n                        n > 0) {\\n                            const t = o.getResponseJson().error;\\n                            if (t && t.status && t.message) {\\n                                const e = function(t) {\\n                                    const e = t.toLowerCase().replace(/_/g, \\\"-\\\");\\n                                    return Object.values(G).indexOf(e) >= 0 ? e : G.UNKNOWN;\\n                                }(t.status);\\n                                r(new Q(e, t.message));\\n                            } else r(new Q(G.UNKNOWN, \\\"Server responded with status \\\" + o.getStatus()));\\n                        } else \\n                        // If we received an HTTP_ERROR but there's no status code,\\n                        // it's most probably a connection issue\\n                        r(new Q(G.UNAVAILABLE, \\\"Connection failed.\\\"));\\n                        break;\\n\\n                      default:\\n                        L();\\n                    }\\n                } finally {\\n                    O(\\\"Connection\\\", 'RPC \\\"' + t + '\\\" completed.');\\n                }\\n            }));\\n            const u = JSON.stringify(s);\\n            o.send(e, \\\"POST\\\", u, n, 15);\\n        }));\\n    }\\n    wo(t, e, n) {\\n        const s = [ this.uo, \\\"/\\\", \\\"google.firestore.v1.Firestore\\\", \\\"/\\\", t, \\\"/channel\\\" ], i = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.createWebChannelTransport)(), r = (0,_firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.getStatEventTarget)(), o = {\\n            // Required for backend stickiness, routing behavior is based on this\\n            // parameter.\\n            httpSessionIdParam: \\\"gsessionid\\\",\\n            initMessageHeaders: {},\\n            messageUrlParams: {\\n                // This param is used to improve routing and project isolation by the\\n                // backend and must be included in every request.\\n                database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\\n            },\\n            sendRawJson: !0,\\n            supportsCrossDomainXhr: !0,\\n            internalChannelParams: {\\n                // Override the default timeout (randomized between 10-20 seconds) since\\n                // a large write batch on a slow internet connection may take a long\\n                // time to send to the backend. Rather than have WebChannel impose a\\n                // tight timeout which could lead to infinite timeouts and retries, we\\n                // set it very large (5-10 minutes) and rely on the browser's builtin\\n                // timeouts to kick in if the request isn't working.\\n                forwardChannelRequestTimeoutMs: 6e5\\n            },\\n            forceLongPolling: this.forceLongPolling,\\n            detectBufferingProxy: this.autoDetectLongPolling\\n        };\\n        this.useFetchStreams && (o.xmlHttpFactory = new _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.FetchXmlHttpFactory({})), this.lo(o.initMessageHeaders, e, n), \\n        // Sending the custom headers we just added to request.initMessageHeaders\\n        // (Authorization, etc.) will trigger the browser to make a CORS preflight\\n        // request because the XHR will no longer meet the criteria for a \\\"simple\\\"\\n        // CORS request:\\n        // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\\n        // Therefore to avoid the CORS preflight request (an extra network\\n        // roundtrip), we use the httpHeadersOverwriteParam option to specify that\\n        // the headers should instead be encoded into a special \\\"$httpHeaders\\\" query\\n        // parameter, which is recognized by the webchannel backend. This is\\n        // formally defined here:\\n        // https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L32\\n        // TODO(b/145624756): There is a backend bug where $httpHeaders isn't respected if the request\\n        // doesn't have an Origin header. So we have to exclude a few browser environments that are\\n        // known to (sometimes) not include an Origin. See\\n        // https://github.com/firebase/firebase-js-sdk/issues/1491.\\n        (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isMobileCordova)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isReactNative)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isElectron)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isIE)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isUWP)() || (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.isBrowserExtension)() || (o.httpHeadersOverwriteParam = \\\"$httpHeaders\\\");\\n        const u = s.join(\\\"\\\");\\n        O(\\\"Connection\\\", \\\"Creating WebChannel: \\\" + u, o);\\n        const a = i.createWebChannel(u, o);\\n        // WebChannel supports sending the first message with the handshake - saving\\n        // a network round trip. However, it will have to call send in the same\\n        // JS event loop as open. In order to enforce this, we delay actually\\n        // opening the WebChannel until send is called. Whether we have called\\n        // open is tracked with this variable.\\n                let c = !1, h = !1;\\n        // A flag to determine whether the stream was closed (by us or through an\\n        // error/close event) to avoid delivering multiple close events or sending\\n        // on a closed stream\\n                const l = new qo({\\n            Jr: t => {\\n                h ? O(\\\"Connection\\\", \\\"Not sending because WebChannel is closed:\\\", t) : (c || (O(\\\"Connection\\\", \\\"Opening WebChannel transport.\\\"), \\n                a.open(), c = !0), O(\\\"Connection\\\", \\\"WebChannel sending:\\\", t), a.send(t));\\n            },\\n            Yr: () => a.close()\\n        }), y = (t, e, n) => {\\n            // TODO(dimond): closure typing seems broken because WebChannel does\\n            // not implement goog.events.Listenable\\n            t.listen(e, (t => {\\n                try {\\n                    n(t);\\n                } catch (t) {\\n                    setTimeout((() => {\\n                        throw t;\\n                    }), 0);\\n                }\\n            }));\\n        };\\n        // Closure events are guarded and exceptions are swallowed, so catch any\\n        // exception and rethrow using a setTimeout so they become visible again.\\n        // Note that eventually this function could go away if we are confident\\n        // enough the code is exception free.\\n                return y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.OPEN, (() => {\\n            h || O(\\\"Connection\\\", \\\"WebChannel transport opened.\\\");\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.CLOSE, (() => {\\n            h || (h = !0, O(\\\"Connection\\\", \\\"WebChannel transport closed\\\"), l.ro());\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.ERROR, (t => {\\n            h || (h = !0, $(\\\"Connection\\\", \\\"WebChannel transport errored:\\\", t), l.ro(new Q(G.UNAVAILABLE, \\\"The operation could not be completed\\\")));\\n        })), y(a, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.WebChannel.EventType.MESSAGE, (t => {\\n            var e;\\n            if (!h) {\\n                const n = t.data[0];\\n                U(!!n);\\n                // TODO(b/35143891): There is a bug in One Platform that caused errors\\n                // (and only errors) to be wrapped in an extra array. To be forward\\n                // compatible with the bug we need to check either condition. The latter\\n                // can be removed once the fix has been rolled out.\\n                // Use any because msgData.error is not typed.\\n                const s = n, i = s.error || (null === (e = s[0]) || void 0 === e ? void 0 : e.error);\\n                if (i) {\\n                    O(\\\"Connection\\\", \\\"WebChannel received error:\\\", i);\\n                    // error.status will be a string like 'OK' or 'NOT_FOUND'.\\n                    const t = i.status;\\n                    let e = \\n                    /**\\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\\n *\\n * @returns The Code equivalent to the given status string or undefined if\\n *     there is no match.\\n */\\n                    function(t) {\\n                        // lookup by string\\n                        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n                        const e = Bn[t];\\n                        if (void 0 !== e) return qn(e);\\n                    }(t), n = i.message;\\n                    void 0 === e && (e = G.INTERNAL, n = \\\"Unknown error status: \\\" + t + \\\" with message \\\" + i.message), \\n                    // Mark closed so no further events are propagated\\n                    h = !0, l.ro(new Q(e, n)), a.close();\\n                } else O(\\\"Connection\\\", \\\"WebChannel received:\\\", n), l.oo(n);\\n            }\\n        })), y(r, _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Event.STAT_EVENT, (t => {\\n            t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.PROXY ? O(\\\"Connection\\\", \\\"Detected buffering proxy\\\") : t.stat === _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_4__.Stat.NOPROXY && O(\\\"Connection\\\", \\\"Detected no buffering proxy\\\");\\n        })), setTimeout((() => {\\n            // Technically we could/should wait for the WebChannel opened event,\\n            // but because we want to send the first message with the WebChannel\\n            // handshake we pretend the channel opened here (asynchronously), and\\n            // then delay the actual open until the first message is sent.\\n            l.io();\\n        }), 0), l;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** Initializes the WebChannelConnection for the browser. */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** The Platform's 'window' implementation or null if not available. */\\nfunction Go() {\\n    // `window` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof window ? window : null;\\n}\\n\\n/** The Platform's 'document' implementation or null if not available. */ function Qo() {\\n    // `document` is not always available, e.g. in ReactNative and WebWorkers.\\n    // eslint-disable-next-line no-restricted-globals\\n    return \\\"undefined\\\" != typeof document ? document : null;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function jo(t) {\\n    return new ls(t, /* useProto3Json= */ !0);\\n}\\n\\n/**\\n * An instance of the Platform's 'TextEncoder' implementation.\\n */\\n/**\\n * A helper for running delayed tasks following an exponential backoff curve\\n * between attempts.\\n *\\n * Each delay is made up of a \\\"base\\\" delay which follows the exponential\\n * backoff curve, and a +/- 50% \\\"jitter\\\" that is calculated and added to the\\n * base delay. This prevents clients from accidentally synchronizing their\\n * delays causing spikes of load to the backend.\\n */\\nclass Wo {\\n    constructor(\\n    /**\\n     * The AsyncQueue to run backoff operations on.\\n     */\\n    t, \\n    /**\\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\\n     */\\n    e, \\n    /**\\n     * The initial delay (used as the base delay on the first retry attempt).\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * little as 0.5*initialDelayMs.\\n     */\\n    n = 1e3\\n    /**\\n     * The multiplier to use to determine the extended base delay after each\\n     * attempt.\\n     */ , s = 1.5\\n    /**\\n     * The maximum base delay after which no further backoff is performed.\\n     * Note that jitter will still be applied, so the actual delay could be as\\n     * much as 1.5*maxDelayMs.\\n     */ , i = 6e4) {\\n        this.Yn = t, this.timerId = e, this.mo = n, this.yo = s, this.po = i, this.Io = 0, \\n        this.To = null, \\n        /** The last backoff attempt, as epoch milliseconds. */\\n        this.Eo = Date.now(), this.reset();\\n    }\\n    /**\\n     * Resets the backoff delay.\\n     *\\n     * The very next backoffAndWait() will have no delay. If it is called again\\n     * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\\n     * subsequent ones will increase according to the backoffFactor.\\n     */    reset() {\\n        this.Io = 0;\\n    }\\n    /**\\n     * Resets the backoff delay to the maximum delay (e.g. for use after a\\n     * RESOURCE_EXHAUSTED error).\\n     */    Ao() {\\n        this.Io = this.po;\\n    }\\n    /**\\n     * Returns a promise that resolves after currentDelayMs, and increases the\\n     * delay for any subsequent attempts. If there was a pending backoff operation\\n     * already, it will be canceled.\\n     */    Ro(t) {\\n        // Cancel any pending backoff operation.\\n        this.cancel();\\n        // First schedule using the current base (which may be 0 and should be\\n        // honored as such).\\n        const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);\\n        // Guard against lastAttemptTime being in the future due to a clock change.\\n                s > 0 && O(\\\"ExponentialBackoff\\\", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`), \\n        this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(), \\n        t()))), \\n        // Apply backoff factor to determine next delay and ensure it is within\\n        // bounds.\\n        this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);\\n    }\\n    Po() {\\n        null !== this.To && (this.To.skipDelay(), this.To = null);\\n    }\\n    cancel() {\\n        null !== this.To && (this.To.cancel(), this.To = null);\\n    }\\n    /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */    bo() {\\n        return (Math.random() - .5) * this.Io;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A PersistentStream is an abstract base class that represents a streaming RPC\\n * to the Firestore backend. It's built on top of the connections own support\\n * for streaming RPCs, and adds several critical features for our clients:\\n *\\n *   - Exponential backoff on failure\\n *   - Authentication via CredentialsProvider\\n *   - Dispatching all callbacks into the shared worker queue\\n *   - Closing idle streams after 60 seconds of inactivity\\n *\\n * Subclasses of PersistentStream implement serialization of models to and\\n * from the JSON representation of the protocol buffers for a specific\\n * streaming RPC.\\n *\\n * ## Starting and Stopping\\n *\\n * Streaming RPCs are stateful and need to be start()ed before messages can\\n * be sent and received. The PersistentStream will call the onOpen() function\\n * of the listener once the stream is ready to accept requests.\\n *\\n * Should a start() fail, PersistentStream will call the registered onClose()\\n * listener with a FirestoreError indicating what went wrong.\\n *\\n * A PersistentStream can be started and stopped repeatedly.\\n *\\n * Generic types:\\n *  SendType: The type of the outgoing message of the underlying\\n *    connection stream\\n *  ReceiveType: The type of the incoming message of the underlying\\n *    connection stream\\n *  ListenerType: The type of the listener that will be used for callbacks\\n */\\nclass zo {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.Yn = t, this.Vo = n, this.vo = s, this.So = i, this.authCredentialsProvider = r, \\n        this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* Initial */ , \\n        /**\\n         * A close count that's incremented every time the stream is closed; used by\\n         * getCloseGuardedDispatcher() to invalidate callbacks that happen after\\n         * close.\\n         */\\n        this.Do = 0, this.Co = null, this.xo = null, this.stream = null, this.No = new Wo(t, e);\\n    }\\n    /**\\n     * Returns true if start() has been called and no error has occurred. True\\n     * indicates the stream is open or in the process of opening (which\\n     * encompasses respecting backoff, getting auth tokens, and starting the\\n     * actual RPC). Use isOpen() to determine if the stream is open and ready for\\n     * outbound requests.\\n     */    ko() {\\n        return 1 /* Starting */ === this.state || 5 /* Backoff */ === this.state || this.Mo();\\n    }\\n    /**\\n     * Returns true if the underlying RPC is open (the onOpen() listener has been\\n     * called) and the stream is ready for outbound requests.\\n     */    Mo() {\\n        return 2 /* Open */ === this.state || 3 /* Healthy */ === this.state;\\n    }\\n    /**\\n     * Starts the RPC. Only allowed if isStarted() returns false. The stream is\\n     * not immediately ready for use: onOpen() will be invoked when the RPC is\\n     * ready for outbound requests, at which point isOpen() will return true.\\n     *\\n     * When start returns, isStarted() will return true.\\n     */    start() {\\n        4 /* Error */ !== this.state ? this.auth() : this.Oo();\\n    }\\n    /**\\n     * Stops the RPC. This call is idempotent and allowed regardless of the\\n     * current isStarted() state.\\n     *\\n     * When stop returns, isStarted() and isOpen() will both return false.\\n     */    async stop() {\\n        this.ko() && await this.close(0 /* Initial */);\\n    }\\n    /**\\n     * After an error the stream will usually back off on the next attempt to\\n     * start it. If the error warrants an immediate restart of the stream, the\\n     * sender can use this to indicate that the receiver should not back off.\\n     *\\n     * Each error will call the onClose() listener. That function can decide to\\n     * inhibit backoff if required.\\n     */    Fo() {\\n        this.state = 0 /* Initial */ , this.No.reset();\\n    }\\n    /**\\n     * Marks this stream as idle. If no further actions are performed on the\\n     * stream for one minute, the stream will automatically close itself and\\n     * notify the stream's onClose() handler with Status.OK. The stream will then\\n     * be in a !isStarted() state, requiring the caller to start the stream again\\n     * before further use.\\n     *\\n     * Only streams that are in state 'Open' can be marked idle, as all other\\n     * states imply pending network operations.\\n     */    $o() {\\n        // Starts the idle time if we are in state 'Open' and are not yet already\\n        // running a timer (in which case the previous idle timeout still applies).\\n        this.Mo() && null === this.Co && (this.Co = this.Yn.enqueueAfterDelay(this.Vo, 6e4, (() => this.Bo())));\\n    }\\n    /** Sends a message to the underlying stream. */    Lo(t) {\\n        this.Uo(), this.stream.send(t);\\n    }\\n    /** Called by the idle timer when the stream should close due to inactivity. */    async Bo() {\\n        if (this.Mo()) \\n        // When timing out an idle stream there's no reason to force the stream into backoff when\\n        // it restarts so set the stream state to Initial instead of Error.\\n        return this.close(0 /* Initial */);\\n    }\\n    /** Marks the stream as active again. */    Uo() {\\n        this.Co && (this.Co.cancel(), this.Co = null);\\n    }\\n    /** Cancels the health check delayed operation. */    qo() {\\n        this.xo && (this.xo.cancel(), this.xo = null);\\n    }\\n    /**\\n     * Closes the stream and cleans up as necessary:\\n     *\\n     * * closes the underlying GRPC stream;\\n     * * calls the onClose handler with the given 'error';\\n     * * sets internal stream state to 'finalState';\\n     * * adjusts the backoff timer based on the error\\n     *\\n     * A new stream can be opened by calling start().\\n     *\\n     * @param finalState - the intended state of the stream after closing.\\n     * @param error - the error the connection was closed with.\\n     */    async close(t, e) {\\n        // Cancel any outstanding timers (they're guaranteed not to execute).\\n        this.Uo(), this.qo(), this.No.cancel(), \\n        // Invalidates any stream-related callbacks (e.g. from auth or the\\n        // underlying stream), guaranteeing they won't execute.\\n        this.Do++, 4 /* Error */ !== t ? \\n        // If this is an intentional close ensure we don't delay our next connection attempt.\\n        this.No.reset() : e && e.code === G.RESOURCE_EXHAUSTED ? (\\n        // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\\n        F(e.toString()), F(\\\"Using maximum backoff delay to prevent overloading the backend.\\\"), \\n        this.No.Ao()) : e && e.code === G.UNAUTHENTICATED && 3 /* Healthy */ !== this.state && (\\n        // \\\"unauthenticated\\\" error means the token was rejected. This should rarely\\n        // happen since both Auth and AppCheck ensure a sufficient TTL when we\\n        // request a token. If a user manually resets their system clock this can\\n        // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\\n        // before we received the first message and we need to invalidate the token\\n        // to ensure that we fetch a new token.\\n        this.authCredentialsProvider.invalidateToken(), this.appCheckCredentialsProvider.invalidateToken()), \\n        // Clean up the underlying stream because we are no longer interested in events.\\n        null !== this.stream && (this.Ko(), this.stream.close(), this.stream = null), \\n        // This state must be assigned before calling onClose() to allow the callback to\\n        // inhibit backoff or otherwise manipulate the state in its non-started state.\\n        this.state = t, \\n        // Notify the listener that the stream closed.\\n        await this.listener.eo(e);\\n    }\\n    /**\\n     * Can be overridden to perform additional cleanup before the stream is closed.\\n     * Calling super.tearDown() is not required.\\n     */    Ko() {}\\n    auth() {\\n        this.state = 1 /* Starting */;\\n        const t = this.Go(this.Do), e = this.Do;\\n        // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\\n                Promise.all([ this.authCredentialsProvider.getToken(), this.appCheckCredentialsProvider.getToken() ]).then((([t, n]) => {\\n            // Stream can be stopped while waiting for authentication.\\n            // TODO(mikelehen): We really should just use dispatchIfNotClosed\\n            // and let this dispatch onto the queue, but that opened a spec test can\\n            // of worms that I don't want to deal with in this PR.\\n            this.Do === e && \\n            // Normally we'd have to schedule the callback on the AsyncQueue.\\n            // However, the following calls are safe to be called outside the\\n            // AsyncQueue since they don't chain asynchronous calls\\n            this.Qo(t, n);\\n        }), (e => {\\n            t((() => {\\n                const t = new Q(G.UNKNOWN, \\\"Fetching auth token failed: \\\" + e.message);\\n                return this.jo(t);\\n            }));\\n        }));\\n    }\\n    Qo(t, e) {\\n        const n = this.Go(this.Do);\\n        this.stream = this.Wo(t, e), this.stream.Xr((() => {\\n            n((() => (this.state = 2 /* Open */ , this.xo = this.Yn.enqueueAfterDelay(this.vo, 1e4, (() => (this.Mo() && (this.state = 3 /* Healthy */), \\n            Promise.resolve()))), this.listener.Xr())));\\n        })), this.stream.eo((t => {\\n            n((() => this.jo(t)));\\n        })), this.stream.onMessage((t => {\\n            n((() => this.onMessage(t)));\\n        }));\\n    }\\n    Oo() {\\n        this.state = 5 /* Backoff */ , this.No.Ro((async () => {\\n            this.state = 0 /* Initial */ , this.start();\\n        }));\\n    }\\n    // Visible for tests\\n    jo(t) {\\n        // In theory the stream could close cleanly, however, in our current model\\n        // we never expect this to happen because if we stop a stream ourselves,\\n        // this callback will never be called. To prevent cases where we retry\\n        // without a backoff accidentally, we set the stream to error in all cases.\\n        return O(\\\"PersistentStream\\\", `close with error: ${t}`), this.stream = null, this.close(4 /* Error */ , t);\\n    }\\n    /**\\n     * Returns a \\\"dispatcher\\\" function that dispatches operations onto the\\n     * AsyncQueue but only runs them if closeCount remains unchanged. This allows\\n     * us to turn auth / stream callbacks into no-ops if the stream is closed /\\n     * re-opened, etc.\\n     */    Go(t) {\\n        return e => {\\n            this.Yn.enqueueAndForget((() => this.Do === t ? e() : (O(\\\"PersistentStream\\\", \\\"stream callback skipped by getCloseGuardedDispatcher.\\\"), \\n            Promise.resolve())));\\n        };\\n    }\\n}\\n\\n/**\\n * A PersistentStream that implements the Listen RPC.\\n *\\n * Once the Listen stream has called the onOpen() listener, any number of\\n * listen() and unlisten() calls can be made to control what changes will be\\n * sent from the server for ListenResponses.\\n */ class Ho extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"listen_stream_connection_backoff\\\" /* ListenStreamConnectionBackoff */ , \\\"listen_stream_idle\\\" /* ListenStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i;\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Listen\\\", t, e);\\n    }\\n    onMessage(t) {\\n        // A successful response means the stream is healthy\\n        this.No.reset();\\n        const e = Vs(this.M, t), n = function(t) {\\n            // We have only reached a consistent snapshot for the entire stream if there\\n            // is a read_time set and it applies to all targets (i.e. the list of\\n            // targets is empty). The backend is guaranteed to send such responses.\\n            if (!(\\\"targetChange\\\" in t)) return ct.min();\\n            const e = t.targetChange;\\n            return e.targetIds && e.targetIds.length ? ct.min() : e.readTime ? ws(e.readTime) : ct.min();\\n        }(t);\\n        return this.listener.zo(e, n);\\n    }\\n    /**\\n     * Registers interest in the results of the given target. If the target\\n     * includes a resumeToken it will be included in the request. Results that\\n     * affect the target will be streamed back as WatchChange messages that\\n     * reference the targetId.\\n     */    Ho(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.addTarget = function(t, e) {\\n            let n;\\n            const s = e.target;\\n            return n = Ae(s) ? {\\n                documents: Cs(t, s)\\n            } : {\\n                query: xs(t, s)\\n            }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = ds(t, e.resumeToken) : e.snapshotVersion.compareTo(ct.min()) > 0 && (\\n            // TODO(wuandy): Consider removing above check because it is most likely true.\\n            // Right now, many tests depend on this behaviour though (leaving min() out\\n            // of serialization).\\n            n.readTime = fs(t, e.snapshotVersion.toTimestamp())), n;\\n        }(this.M, t);\\n        const n = ks(this.M, t);\\n        n && (e.labels = n), this.Lo(e);\\n    }\\n    /**\\n     * Unregisters interest in the results of the target associated with the\\n     * given targetId.\\n     */    Jo(t) {\\n        const e = {};\\n        e.database = Es(this.M), e.removeTarget = t, this.Lo(e);\\n    }\\n}\\n\\n/**\\n * A Stream that implements the Write RPC.\\n *\\n * The Write RPC requires the caller to maintain special streamToken\\n * state in between calls, to help the server understand which responses the\\n * client has processed by the time the next request is made. Every response\\n * will contain a streamToken; this value must be passed to the next\\n * request.\\n *\\n * After calling start() on this stream, the next request must be a handshake,\\n * containing whatever streamToken is on hand. Once a response to this\\n * request is received, all pending mutations may be submitted. When\\n * submitting multiple batches of mutations at the same time, it's\\n * okay to use the same streamToken for the calls to writeMutations.\\n *\\n * TODO(b/33271235): Use proto types\\n */ class Jo extends zo {\\n    constructor(t, e, n, s, i, r) {\\n        super(t, \\\"write_stream_connection_backoff\\\" /* WriteStreamConnectionBackoff */ , \\\"write_stream_idle\\\" /* WriteStreamIdle */ , \\\"health_check_timeout\\\" /* HealthCheckTimeout */ , e, n, s, r), \\n        this.M = i, this.Yo = !1;\\n    }\\n    /**\\n     * Tracks whether or not a handshake has been successfully exchanged and\\n     * the stream is ready to accept mutations.\\n     */    get Xo() {\\n        return this.Yo;\\n    }\\n    // Override of PersistentStream.start\\n    start() {\\n        this.Yo = !1, this.lastStreamToken = void 0, super.start();\\n    }\\n    Ko() {\\n        this.Yo && this.Zo([]);\\n    }\\n    Wo(t, e) {\\n        return this.So.wo(\\\"Write\\\", t, e);\\n    }\\n    onMessage(t) {\\n        if (\\n        // Always capture the last stream token.\\n        U(!!t.streamToken), this.lastStreamToken = t.streamToken, this.Yo) {\\n            // A successful first write response means the stream is healthy,\\n            // Note, that we could consider a successful handshake healthy, however,\\n            // the write itself might be causing an error we want to back off from.\\n            this.No.reset();\\n            const e = Ds(t.writeResults, t.commitTime), n = ws(t.commitTime);\\n            return this.listener.tu(n, e);\\n        }\\n        // The first response is always the handshake response\\n        return U(!t.writeResults || 0 === t.writeResults.length), this.Yo = !0, this.listener.eu();\\n    }\\n    /**\\n     * Sends an initial streamToken to the server, performing the handshake\\n     * required to make the StreamingWrite RPC work. Subsequent\\n     * calls should wait until onHandshakeComplete was called.\\n     */    nu() {\\n        // TODO(dimond): Support stream resumption. We intentionally do not set the\\n        // stream token on the handshake, ignoring any stream token we might have.\\n        const t = {};\\n        t.database = Es(this.M), this.Lo(t);\\n    }\\n    /** Sends a group of mutations to the Firestore backend to apply. */    Zo(t) {\\n        const e = {\\n            streamToken: this.lastStreamToken,\\n            writes: t.map((t => vs(this.M, t)))\\n        };\\n        this.Lo(e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Datastore and its related methods are a wrapper around the external Google\\n * Cloud Datastore grpc API, which provides an interface that is more convenient\\n * for the rest of the client SDK architecture to consume.\\n */\\n/**\\n * An implementation of Datastore that exposes additional state for internal\\n * consumption.\\n */\\nclass Yo extends class {} {\\n    constructor(t, e, n, s) {\\n        super(), this.authCredentials = t, this.appCheckCredentials = e, this.So = n, this.M = s, \\n        this.su = !1;\\n    }\\n    iu() {\\n        if (this.su) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    /** Invokes the provided RPC with auth and AppCheck tokens. */    co(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So.co(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */    _o(t, e, n) {\\n        return this.iu(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.So._o(t, e, n, s, i))).catch((t => {\\n            throw \\\"FirebaseError\\\" === t.name ? (t.code === G.UNAUTHENTICATED && (this.authCredentials.invalidateToken(), \\n            this.appCheckCredentials.invalidateToken()), t) : new Q(G.UNKNOWN, t.toString());\\n        }));\\n    }\\n    terminate() {\\n        this.su = !0;\\n    }\\n}\\n\\n// TODO(firestorexp): Make sure there is only one Datastore instance per\\n// firestore-exp client.\\n/**\\n * A component used by the RemoteStore to track the OnlineState (that is,\\n * whether or not the client as a whole should be considered to be online or\\n * offline), implementing the appropriate heuristics.\\n *\\n * In particular, when the client is trying to connect to the backend, we\\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\\n * a connection to succeed. If we have too many failures or the timeout elapses,\\n * then we set the OnlineState to Offline, and the client will behave as if\\n * it is offline (get()s will return cached data, etc.).\\n */\\nclass Xo {\\n    constructor(t, e) {\\n        this.asyncQueue = t, this.onlineStateHandler = e, \\n        /** The current OnlineState. */\\n        this.state = \\\"Unknown\\\" /* Unknown */ , \\n        /**\\n         * A count of consecutive failures to open the stream. If it reaches the\\n         * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\\n         * Offline.\\n         */\\n        this.ru = 0, \\n        /**\\n         * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\\n         * transition from OnlineState.Unknown to OnlineState.Offline without waiting\\n         * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\\n         */\\n        this.ou = null, \\n        /**\\n         * Whether the client should log a warning message if it fails to connect to\\n         * the backend (initially true, cleared after a successful stream, or if we've\\n         * logged the message already).\\n         */\\n        this.uu = !0;\\n    }\\n    /**\\n     * Called by RemoteStore when a watch stream is started (including on each\\n     * backoff attempt).\\n     *\\n     * If this is the first attempt, it sets the OnlineState to Unknown and starts\\n     * the onlineStateTimer.\\n     */    au() {\\n        0 === this.ru && (this.cu(\\\"Unknown\\\" /* Unknown */), this.ou = this.asyncQueue.enqueueAfterDelay(\\\"online_state_timeout\\\" /* OnlineStateTimeout */ , 1e4, (() => (this.ou = null, \\n        this.hu(\\\"Backend didn't respond within 10 seconds.\\\"), this.cu(\\\"Offline\\\" /* Offline */), \\n        Promise.resolve()))));\\n    }\\n    /**\\n     * Updates our OnlineState as appropriate after the watch stream reports a\\n     * failure. The first failure moves us to the 'Unknown' state. We then may\\n     * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\\n     * actually transition to the 'Offline' state.\\n     */    lu(t) {\\n        \\\"Online\\\" /* Online */ === this.state ? this.cu(\\\"Unknown\\\" /* Unknown */) : (this.ru++, \\n        this.ru >= 1 && (this.fu(), this.hu(`Connection failed 1 times. Most recent error: ${t.toString()}`), \\n        this.cu(\\\"Offline\\\" /* Offline */)));\\n    }\\n    /**\\n     * Explicitly sets the OnlineState to the specified state.\\n     *\\n     * Note that this resets our timers / failure counters, etc. used by our\\n     * Offline heuristics, so must not be used in place of\\n     * handleWatchStreamStart() and handleWatchStreamFailure().\\n     */    set(t) {\\n        this.fu(), this.ru = 0, \\\"Online\\\" /* Online */ === t && (\\n        // We've connected to watch at least once. Don't warn the developer\\n        // about being offline going forward.\\n        this.uu = !1), this.cu(t);\\n    }\\n    cu(t) {\\n        t !== this.state && (this.state = t, this.onlineStateHandler(t));\\n    }\\n    hu(t) {\\n        const e = `Could not reach Cloud Firestore backend. ${t}\\\\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;\\n        this.uu ? (F(e), this.uu = !1) : O(\\\"OnlineStateTracker\\\", e);\\n    }\\n    fu() {\\n        null !== this.ou && (this.ou.cancel(), this.ou = null);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Zo {\\n    constructor(\\n    /**\\n     * The local store, used to fill the write pipeline with outbound mutations.\\n     */\\n    t, \\n    /** The client-side proxy for interacting with the backend. */\\n    e, n, s, i) {\\n        this.localStore = t, this.datastore = e, this.asyncQueue = n, this.remoteSyncer = {}, \\n        /**\\n         * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\\n         * LocalStore via fillWritePipeline() and have or will send to the write\\n         * stream.\\n         *\\n         * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\\n         * restart the write stream. When the stream is established the writes in the\\n         * pipeline will be sent in order.\\n         *\\n         * Writes remain in writePipeline until they are acknowledged by the backend\\n         * and thus will automatically be re-sent if the stream is interrupted /\\n         * restarted before they're acknowledged.\\n         *\\n         * Write responses from the backend are linked to their originating request\\n         * purely based on order, and so we can just shift() writes from the front of\\n         * the writePipeline as we receive responses.\\n         */\\n        this.du = [], \\n        /**\\n         * A mapping of watched targets that the client cares about tracking and the\\n         * user has explicitly called a 'listen' for this target.\\n         *\\n         * These targets may or may not have been sent to or acknowledged by the\\n         * server. On re-establishing the listen stream, these targets should be sent\\n         * to the server. The targets removed with unlistens are removed eagerly\\n         * without waiting for confirmation from the listen stream.\\n         */\\n        this._u = new Map, \\n        /**\\n         * A set of reasons for why the RemoteStore may be offline. If empty, the\\n         * RemoteStore may start its network connections.\\n         */\\n        this.wu = new Set, \\n        /**\\n         * Event handlers that get called when the network is disabled or enabled.\\n         *\\n         * PORTING NOTE: These functions are used on the Web client to create the\\n         * underlying streams (to support tree-shakeable streams). On Android and iOS,\\n         * the streams are created during construction of RemoteStore.\\n         */\\n        this.mu = [], this.gu = i, this.gu.Kr((t => {\\n            n.enqueueAndForget((async () => {\\n                // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\\n                // network becomes unreachable as we don't have any other way to tear\\n                // down our streams.\\n                au(this) && (O(\\\"RemoteStore\\\", \\\"Restarting streams for network reachability change.\\\"), \\n                await async function(t) {\\n                    const e = K(t);\\n                    e.wu.add(4 /* ConnectivityChange */), await eu(e), e.yu.set(\\\"Unknown\\\" /* Unknown */), \\n                    e.wu.delete(4 /* ConnectivityChange */), await tu(e);\\n                }(this));\\n            }));\\n        })), this.yu = new Xo(n, s);\\n    }\\n}\\n\\nasync function tu(t) {\\n    if (au(t)) for (const e of t.mu) await e(/* enabled= */ !0);\\n}\\n\\n/**\\n * Temporarily disables the network. The network can be re-enabled using\\n * enableNetwork().\\n */ async function eu(t) {\\n    for (const e of t.mu) await e(/* enabled= */ !1);\\n}\\n\\n/**\\n * Starts new listen for the given target. Uses resume token if provided. It\\n * is a no-op if the target of given `TargetData` is already being listened to.\\n */\\nfunction nu(t, e) {\\n    const n = K(t);\\n    n._u.has(e.targetId) || (\\n    // Mark this as something the client is currently listening for.\\n    n._u.set(e.targetId, e), uu(n) ? \\n    // The listen will be sent in onWatchStreamOpen\\n    ou(n) : Pu(n).Mo() && iu(n, e));\\n}\\n\\n/**\\n * Removes the listen from server. It is a no-op if the given target id is\\n * not being listened to.\\n */ function su(t, e) {\\n    const n = K(t), s = Pu(n);\\n    n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) && \\n    // Revert to OnlineState.Unknown if the watch stream is not open and we\\n    // have no listeners, since without any listens to send we cannot\\n    // confirm if the stream is healthy and upgrade to OnlineState.Online.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * We need to increment the the expected number of pending responses we're due\\n * from watch so we wait for the ack to process any messages from this target.\\n */ function iu(t, e) {\\n    t.pu.Z(e.targetId), Pu(t).Ho(e);\\n}\\n\\n/**\\n * We need to increment the expected number of pending responses we're due\\n * from watch so we wait for the removal on the server before we process any\\n * messages from this target.\\n */ function ru(t, e) {\\n    t.pu.Z(e), Pu(t).Jo(e);\\n}\\n\\nfunction ou(t) {\\n    t.pu = new os({\\n        getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),\\n        Et: e => t._u.get(e) || null\\n    }), Pu(t).start(), t.yu.au();\\n}\\n\\n/**\\n * Returns whether the watch stream should be started because it's necessary\\n * and has not yet been started.\\n */ function uu(t) {\\n    return au(t) && !Pu(t).ko() && t._u.size > 0;\\n}\\n\\nfunction au(t) {\\n    return 0 === K(t).wu.size;\\n}\\n\\nfunction cu(t) {\\n    t.pu = void 0;\\n}\\n\\nasync function hu(t) {\\n    t._u.forEach(((e, n) => {\\n        iu(t, e);\\n    }));\\n}\\n\\nasync function lu(t, e) {\\n    cu(t), \\n    // If we still need the watch stream, retry the connection.\\n    uu(t) ? (t.yu.lu(e), ou(t)) : \\n    // No need to restart watch stream because there are no active targets.\\n    // The online state is set to unknown because there is no active attempt\\n    // at establishing a connection\\n    t.yu.set(\\\"Unknown\\\" /* Unknown */);\\n}\\n\\nasync function fu(t, e, n) {\\n    if (\\n    // Mark the client as online since we got a message from the server\\n    t.yu.set(\\\"Online\\\" /* Online */), e instanceof is && 2 /* Removed */ === e.state && e.cause) \\n    // There was an error on a target, don't wait for a consistent snapshot\\n    // to raise events\\n    try {\\n        await \\n        /** Handles an error on a target */\\n        async function(t, e) {\\n            const n = e.cause;\\n            for (const s of e.targetIds) \\n            // A watched target might have been removed already.\\n            t._u.has(s) && (await t.remoteSyncer.rejectListen(s, n), t._u.delete(s), t.pu.removeTarget(s));\\n        }\\n        /**\\n * Attempts to fill our write pipeline with writes from the LocalStore.\\n *\\n * Called internally to bootstrap or refill the write pipeline and by\\n * SyncEngine whenever there are new mutations to process.\\n *\\n * Starts the write stream if necessary.\\n */ (t, e);\\n    } catch (n) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to remove targets %s: %s \\\", e.targetIds.join(\\\",\\\"), n), \\n        await du(t, n);\\n    } else if (e instanceof ns ? t.pu.ut(e) : e instanceof ss ? t.pu._t(e) : t.pu.ht(e), \\n    !n.isEqual(ct.min())) try {\\n        const e = await ro(t.localStore);\\n        n.compareTo(e) >= 0 && \\n        // We have received a target change with a global snapshot if the snapshot\\n        // version is not equal to SnapshotVersion.min().\\n        await \\n        /**\\n * Takes a batch of changes from the Datastore, repackages them as a\\n * RemoteEvent, and passes that on to the listener, which is typically the\\n * SyncEngine.\\n */\\n        function(t, e) {\\n            const n = t.pu.yt(e);\\n            // Update in-memory resume tokens. LocalStore will update the\\n            // persistent view of these when applying the completed RemoteEvent.\\n                        return n.targetChanges.forEach(((n, s) => {\\n                if (n.resumeToken.approximateByteSize() > 0) {\\n                    const i = t._u.get(s);\\n                    // A watched target might have been removed already.\\n                                        i && t._u.set(s, i.withResumeToken(n.resumeToken, e));\\n                }\\n            })), \\n            // Re-establish listens for the targets that have been invalidated by\\n            // existence filter mismatches.\\n            n.targetMismatches.forEach((e => {\\n                const n = t._u.get(e);\\n                if (!n) \\n                // A watched target might have been removed already.\\n                return;\\n                // Clear the resume token for the target, since we're in a known mismatch\\n                // state.\\n                                t._u.set(e, n.withResumeToken(pt.EMPTY_BYTE_STRING, n.snapshotVersion)), \\n                // Cause a hard reset by unwatching and rewatching immediately, but\\n                // deliberately don't send a resume token so that we get a full update.\\n                ru(t, e);\\n                // Mark the target we send as being on behalf of an existence filter\\n                // mismatch, but don't actually retain that in listenTargets. This ensures\\n                // that we flag the first re-listen this way without impacting future\\n                // listens of this target (that might happen e.g. on reconnect).\\n                const s = new Ni(n.target, e, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);\\n                iu(t, s);\\n            })), t.remoteSyncer.applyRemoteEvent(n);\\n        }(t, n);\\n    } catch (e) {\\n        O(\\\"RemoteStore\\\", \\\"Failed to raise snapshot:\\\", e), await du(t, e);\\n    }\\n}\\n\\n/**\\n * Recovery logic for IndexedDB errors that takes the network offline until\\n * `op` succeeds. Retries are scheduled with backoff using\\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\\n * validated via a generic operation.\\n *\\n * The returned Promise is resolved once the network is disabled and before\\n * any retry attempt.\\n */ async function du(t, e, n) {\\n    if (!Ai(e)) throw e;\\n    t.wu.add(1 /* IndexedDbFailed */), \\n    // Disable network and raise offline snapshots\\n    await eu(t), t.yu.set(\\\"Offline\\\" /* Offline */), n || (\\n    // Use a simple read operation to determine if IndexedDB recovered.\\n    // Ideally, we would expose a health check directly on SimpleDb, but\\n    // RemoteStore only has access to persistence through LocalStore.\\n    n = () => ro(t.localStore)), \\n    // Probe IndexedDB periodically and re-enable network\\n    t.asyncQueue.enqueueRetryable((async () => {\\n        O(\\\"RemoteStore\\\", \\\"Retrying IndexedDB access\\\"), await n(), t.wu.delete(1 /* IndexedDbFailed */), \\n        await tu(t);\\n    }));\\n}\\n\\n/**\\n * Executes `op`. If `op` fails, takes the network offline until `op`\\n * succeeds. Returns after the first attempt.\\n */ function _u(t, e) {\\n    return e().catch((n => du(t, n, e)));\\n}\\n\\nasync function wu(t) {\\n    const e = K(t), n = Vu(e);\\n    let s = e.du.length > 0 ? e.du[e.du.length - 1].batchId : -1;\\n    for (;mu(e); ) try {\\n        const t = await ao(e.localStore, s);\\n        if (null === t) {\\n            0 === e.du.length && n.$o();\\n            break;\\n        }\\n        s = t.batchId, gu(e, t);\\n    } catch (t) {\\n        await du(e, t);\\n    }\\n    yu(e) && pu(e);\\n}\\n\\n/**\\n * Returns true if we can add to the write pipeline (i.e. the network is\\n * enabled and the write pipeline is not full).\\n */ function mu(t) {\\n    return au(t) && t.du.length < 10;\\n}\\n\\n/**\\n * Queues additional writes to be sent to the write stream, sending them\\n * immediately if the write stream is established.\\n */ function gu(t, e) {\\n    t.du.push(e);\\n    const n = Vu(t);\\n    n.Mo() && n.Xo && n.Zo(e.mutations);\\n}\\n\\nfunction yu(t) {\\n    return au(t) && !Vu(t).ko() && t.du.length > 0;\\n}\\n\\nfunction pu(t) {\\n    Vu(t).start();\\n}\\n\\nasync function Iu(t) {\\n    Vu(t).nu();\\n}\\n\\nasync function Tu(t) {\\n    const e = Vu(t);\\n    // Send the write pipeline now that the stream is established.\\n        for (const n of t.du) e.Zo(n.mutations);\\n}\\n\\nasync function Eu(t, e, n) {\\n    const s = t.du.shift(), i = Ci.from(s, e, n);\\n    await _u(t, (() => t.remoteSyncer.applySuccessfulWrite(i))), \\n    // It's possible that with the completion of this mutation another\\n    // slot has freed up.\\n    await wu(t);\\n}\\n\\nasync function Au(t, e) {\\n    // If the write stream closed after the write handshake completes, a write\\n    // operation failed and we fail the pending operation.\\n    e && Vu(t).Xo && \\n    // This error affects the actual write.\\n    await async function(t, e) {\\n        // Only handle permanent errors here. If it's transient, just let the retry\\n        // logic kick in.\\n        if (n = e.code, Un(n) && n !== G.ABORTED) {\\n            // This was a permanent error, the request itself was the problem\\n            // so it's not going to succeed if we resend it.\\n            const n = t.du.shift();\\n            // In this case it's also unlikely that the server itself is melting\\n            // down -- this was just a bad request so inhibit backoff on the next\\n            // restart.\\n                        Vu(t).Fo(), await _u(t, (() => t.remoteSyncer.rejectFailedWrite(n.batchId, e))), \\n            // It's possible that with the completion of this mutation\\n            // another slot has freed up.\\n            await wu(t);\\n        }\\n        var n;\\n    }(t, e), \\n    // The write stream might have been started by refilling the write\\n    // pipeline for failed writes\\n    yu(t) && pu(t);\\n}\\n\\nasync function Ru(t, e) {\\n    const n = K(t);\\n    n.asyncQueue.verifyOperationInProgress(), O(\\\"RemoteStore\\\", \\\"RemoteStore received new credentials\\\");\\n    const s = au(n);\\n    // Tear down and re-create our network streams. This will ensure we get a\\n    // fresh auth token for the new user and re-fill the write pipeline with\\n    // new mutations from the LocalStore (since mutations are per-user).\\n        n.wu.add(3 /* CredentialChange */), await eu(n), s && \\n    // Don't set the network status to Unknown if we are offline.\\n    n.yu.set(\\\"Unknown\\\" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e), \\n    n.wu.delete(3 /* CredentialChange */), await tu(n);\\n}\\n\\n/**\\n * Toggles the network state when the client gains or loses its primary lease.\\n */ async function bu(t, e) {\\n    const n = K(t);\\n    e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */), \\n    await eu(n), n.yu.set(\\\"Unknown\\\" /* Unknown */));\\n}\\n\\n/**\\n * If not yet initialized, registers the WatchStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Pu(t) {\\n    return t.Iu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Iu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Ho(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }\\n    /**\\n * @license\\n * Copyright 2018 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.datastore, t.asyncQueue, {\\n        Xr: hu.bind(null, t),\\n        eo: lu.bind(null, t),\\n        zo: fu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Iu.Fo(), uu(t) ? ou(t) : t.yu.set(\\\"Unknown\\\" /* Unknown */)) : (await t.Iu.stop(), \\n        cu(t));\\n    }))), t.Iu;\\n}\\n\\n/**\\n * If not yet initialized, registers the WriteStream and its network state\\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\\n * already available.\\n *\\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\\n * This is not done on Web to allow it to be tree-shaken.\\n */ function Vu(t) {\\n    return t.Tu || (\\n    // Create stream (but note that it is not started yet).\\n    t.Tu = function(t, e, n) {\\n        const s = K(t);\\n        return s.iu(), new Jo(e, s.So, s.authCredentials, s.appCheckCredentials, s.M, n);\\n    }(t.datastore, t.asyncQueue, {\\n        Xr: Iu.bind(null, t),\\n        eo: Au.bind(null, t),\\n        eu: Tu.bind(null, t),\\n        tu: Eu.bind(null, t)\\n    }), t.mu.push((async e => {\\n        e ? (t.Tu.Fo(), \\n        // This will start the write stream if necessary.\\n        await wu(t)) : (await t.Tu.stop(), t.du.length > 0 && (O(\\\"RemoteStore\\\", `Stopping write stream with ${t.du.length} pending writes`), \\n        t.du = []));\\n    }))), t.Tu;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\\n *\\n * It is created via DelayedOperation.createAndSchedule().\\n *\\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\\n *\\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\\n * in newer versions of TypeScript defines `finally`, which is not available in\\n * IE.\\n */\\nclass vu {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = s, this.removalCallback = i, \\n        this.deferred = new j, this.then = this.deferred.promise.then.bind(this.deferred.promise), \\n        // It's normal for the deferred promise to be canceled (due to cancellation)\\n        // and so we attach a dummy catch callback to avoid\\n        // 'UnhandledPromiseRejectionWarning' log spam.\\n        this.deferred.promise.catch((t => {}));\\n    }\\n    /**\\n     * Creates and returns a DelayedOperation that has been scheduled to be\\n     * executed on the provided asyncQueue after the provided delayMs.\\n     *\\n     * @param asyncQueue - The queue to schedule the operation on.\\n     * @param id - A Timer ID identifying the type of operation this is.\\n     * @param delayMs - The delay (ms) before the operation should be scheduled.\\n     * @param op - The operation to run.\\n     * @param removalCallback - A callback to be called synchronously once the\\n     *   operation is executed or canceled, notifying the AsyncQueue to remove it\\n     *   from its delayedOperations list.\\n     *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\\n     *   the DelayedOperation class public.\\n     */    static createAndSchedule(t, e, n, s, i) {\\n        const r = Date.now() + n, o = new vu(t, e, r, s, i);\\n        return o.start(n), o;\\n    }\\n    /**\\n     * Starts the timer. This is called immediately after construction by\\n     * createAndSchedule().\\n     */    start(t) {\\n        this.timerHandle = setTimeout((() => this.handleDelayElapsed()), t);\\n    }\\n    /**\\n     * Queues the operation to run immediately (if it hasn't already been run or\\n     * canceled).\\n     */    skipDelay() {\\n        return this.handleDelayElapsed();\\n    }\\n    /**\\n     * Cancels the operation if it hasn't already been executed or canceled. The\\n     * promise will be rejected.\\n     *\\n     * As long as the operation has not yet been run, calling cancel() provides a\\n     * guarantee that the operation will not be run.\\n     */    cancel(t) {\\n        null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Q(G.CANCELLED, \\\"Operation cancelled\\\" + (t ? \\\": \\\" + t : \\\"\\\"))));\\n    }\\n    handleDelayElapsed() {\\n        this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(), \\n        this.op().then((t => this.deferred.resolve(t)))) : Promise.resolve()));\\n    }\\n    clearTimeout() {\\n        null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), \\n        this.timerHandle = null);\\n    }\\n}\\n\\n/**\\n * Returns a FirestoreError that can be surfaced to the user if the provided\\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\\n */ function Su(t, e) {\\n    if (F(\\\"AsyncQueue\\\", `${e}: ${t}`), Ai(t)) return new Q(G.UNAVAILABLE, `${e}: ${t}`);\\n    throw t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\\n * in order specified by the provided comparator. We always add a document key\\n * comparator on top of what is provided to guarantee document equality based on\\n * the key.\\n */ class Du {\\n    /** The default ordering is by key if the comparator is omitted */\\n    constructor(t) {\\n        // We are adding document key comparator to the end as it's the only\\n        // guaranteed unique property of a document.\\n        this.comparator = t ? (e, n) => t(e, n) || xt.comparator(e.key, n.key) : (t, e) => xt.comparator(t.key, e.key), \\n        this.keyedMap = Wn(), this.sortedSet = new fe(this.comparator);\\n    }\\n    /**\\n     * Returns an empty copy of the existing DocumentSet, using the same\\n     * comparator.\\n     */    static emptySet(t) {\\n        return new Du(t.comparator);\\n    }\\n    has(t) {\\n        return null != this.keyedMap.get(t);\\n    }\\n    get(t) {\\n        return this.keyedMap.get(t);\\n    }\\n    first() {\\n        return this.sortedSet.minKey();\\n    }\\n    last() {\\n        return this.sortedSet.maxKey();\\n    }\\n    isEmpty() {\\n        return this.sortedSet.isEmpty();\\n    }\\n    /**\\n     * Returns the index of the provided key in the document set, or -1 if the\\n     * document key is not present in the set;\\n     */    indexOf(t) {\\n        const e = this.keyedMap.get(t);\\n        return e ? this.sortedSet.indexOf(e) : -1;\\n    }\\n    get size() {\\n        return this.sortedSet.size;\\n    }\\n    /** Iterates documents in order defined by \\\"comparator\\\" */    forEach(t) {\\n        this.sortedSet.inorderTraversal(((e, n) => (t(e), !1)));\\n    }\\n    /** Inserts or updates a document with the same key */    add(t) {\\n        // First remove the element if we have it.\\n        const e = this.delete(t.key);\\n        return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null));\\n    }\\n    /** Deletes a document with a given key */    delete(t) {\\n        const e = this.get(t);\\n        return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this;\\n    }\\n    isEqual(t) {\\n        if (!(t instanceof Du)) return !1;\\n        if (this.size !== t.size) return !1;\\n        const e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator();\\n        for (;e.hasNext(); ) {\\n            const t = e.getNext().key, s = n.getNext().key;\\n            if (!t.isEqual(s)) return !1;\\n        }\\n        return !0;\\n    }\\n    toString() {\\n        const t = [];\\n        return this.forEach((e => {\\n            t.push(e.toString());\\n        })), 0 === t.length ? \\\"DocumentSet ()\\\" : \\\"DocumentSet (\\\\n  \\\" + t.join(\\\"  \\\\n\\\") + \\\"\\\\n)\\\";\\n    }\\n    copy(t, e) {\\n        const n = new Du;\\n        return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\\n * duplicate events for the same doc.\\n */ class Cu {\\n    constructor() {\\n        this.Eu = new fe(xt.comparator);\\n    }\\n    track(t) {\\n        const e = t.doc.key, n = this.Eu.get(e);\\n        n ? \\n        // Merge the new change with the existing change.\\n        0 /* Added */ !== t.type && 3 /* Metadata */ === n.type ? this.Eu = this.Eu.insert(e, t) : 3 /* Metadata */ === t.type && 1 /* Removed */ !== n.type ? this.Eu = this.Eu.insert(e, {\\n            type: n.type,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : 2 /* Modified */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 0 /* Added */ ,\\n            doc: t.doc\\n        }) : 1 /* Removed */ === t.type && 0 /* Added */ === n.type ? this.Eu = this.Eu.remove(e) : 1 /* Removed */ === t.type && 2 /* Modified */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 1 /* Removed */ ,\\n            doc: n.doc\\n        }) : 0 /* Added */ === t.type && 1 /* Removed */ === n.type ? this.Eu = this.Eu.insert(e, {\\n            type: 2 /* Modified */ ,\\n            doc: t.doc\\n        }) : \\n        // This includes these cases, which don't make sense:\\n        // Added->Added\\n        // Removed->Removed\\n        // Modified->Added\\n        // Removed->Modified\\n        // Metadata->Added\\n        // Removed->Metadata\\n        L() : this.Eu = this.Eu.insert(e, t);\\n    }\\n    Au() {\\n        const t = [];\\n        return this.Eu.inorderTraversal(((e, n) => {\\n            t.push(n);\\n        })), t;\\n    }\\n}\\n\\nclass xu {\\n    constructor(t, e, n, s, i, r, o, u) {\\n        this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i, \\n        this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = u;\\n    }\\n    /** Returns a view snapshot as if all documents in the snapshot were added. */    static fromInitialDocuments(t, e, n, s) {\\n        const i = [];\\n        return e.forEach((t => {\\n            i.push({\\n                type: 0 /* Added */ ,\\n                doc: t\\n            });\\n        })), new xu(t, e, Du.emptySet(e), i, n, s, \\n        /* syncStateChanged= */ !0, \\n        /* excludesMetadataChanges= */ !1);\\n    }\\n    get hasPendingWrites() {\\n        return !this.mutatedKeys.isEmpty();\\n    }\\n    isEqual(t) {\\n        if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Ye(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !1;\\n        const e = this.docChanges, n = t.docChanges;\\n        if (e.length !== n.length) return !1;\\n        for (let t = 0; t < e.length; t++) if (e[t].type !== n[t].type || !e[t].doc.isEqual(n[t].doc)) return !1;\\n        return !0;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Holds the listeners and the last received ViewSnapshot for a query being\\n * tracked by EventManager.\\n */ class Nu {\\n    constructor() {\\n        this.Ru = void 0, this.listeners = [];\\n    }\\n}\\n\\nclass ku {\\n    constructor() {\\n        this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        this.bu = new Set;\\n    }\\n}\\n\\nasync function Mu(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1, r = n.queries.get(s);\\n    if (r || (i = !0, r = new Nu), i) try {\\n        r.Ru = await n.onListen(s);\\n    } catch (t) {\\n        const n = Su(t, `Initialization of query '${Ze(e.query)}' failed`);\\n        return void e.onError(n);\\n    }\\n    if (n.queries.set(s, r), r.listeners.push(e), \\n    // Run global snapshot listeners if a consistent snapshot has been emitted.\\n    e.Pu(n.onlineState), r.Ru) {\\n        e.Vu(r.Ru) && Bu(n);\\n    }\\n}\\n\\nasync function Ou(t, e) {\\n    const n = K(t), s = e.query;\\n    let i = !1;\\n    const r = n.queries.get(s);\\n    if (r) {\\n        const t = r.listeners.indexOf(e);\\n        t >= 0 && (r.listeners.splice(t, 1), i = 0 === r.listeners.length);\\n    }\\n    if (i) return n.queries.delete(s), n.onUnlisten(s);\\n}\\n\\nfunction Fu(t, e) {\\n    const n = K(t);\\n    let s = !1;\\n    for (const t of e) {\\n        const e = t.query, i = n.queries.get(e);\\n        if (i) {\\n            for (const e of i.listeners) e.Vu(t) && (s = !0);\\n            i.Ru = t;\\n        }\\n    }\\n    s && Bu(n);\\n}\\n\\nfunction $u(t, e, n) {\\n    const s = K(t), i = s.queries.get(e);\\n    if (i) for (const t of i.listeners) t.onError(n);\\n    // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\\n    // after an error.\\n        s.queries.delete(e);\\n}\\n\\n// Call all global snapshot listeners that have been set.\\nfunction Bu(t) {\\n    t.bu.forEach((t => {\\n        t.next();\\n    }));\\n}\\n\\n/**\\n * QueryListener takes a series of internal view snapshots and determines\\n * when to raise the event.\\n *\\n * It uses an Observer to dispatch events.\\n */ class Lu {\\n    constructor(t, e, n) {\\n        this.query = t, this.vu = e, \\n        /**\\n         * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\\n         * observer. This flag is set to true once we've actually raised an event.\\n         */\\n        this.Su = !1, this.Du = null, this.onlineState = \\\"Unknown\\\" /* Unknown */ , this.options = n || {};\\n    }\\n    /**\\n     * Applies the new ViewSnapshot to this listener, raising a user-facing event\\n     * if applicable (depending on what changed, whether the user has opted into\\n     * metadata-only changes, etc.). Returns true if a user-facing event was\\n     * indeed raised.\\n     */    Vu(t) {\\n        if (!this.options.includeMetadataChanges) {\\n            // Remove the metadata only changes.\\n            const e = [];\\n            for (const n of t.docChanges) 3 /* Metadata */ !== n.type && e.push(n);\\n            t = new xu(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, \\n            /* excludesMetadataChanges= */ !0);\\n        }\\n        let e = !1;\\n        return this.Su ? this.Cu(t) && (this.vu.next(t), e = !0) : this.xu(t, this.onlineState) && (this.Nu(t), \\n        e = !0), this.Du = t, e;\\n    }\\n    onError(t) {\\n        this.vu.error(t);\\n    }\\n    /** Returns whether a snapshot was raised. */    Pu(t) {\\n        this.onlineState = t;\\n        let e = !1;\\n        return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0), \\n        e;\\n    }\\n    xu(t, e) {\\n        // Always raise the first event when we're synced\\n        if (!t.fromCache) return !0;\\n        // NOTE: We consider OnlineState.Unknown as online (it should become Offline\\n        // or Online if we wait long enough).\\n                const n = \\\"Offline\\\" /* Offline */ !== e;\\n        // Don't raise the event if we're online, aren't synced yet (checked\\n        // above) and are waiting for a sync.\\n                return (!this.options.ku || !n) && (!t.docs.isEmpty() || \\\"Offline\\\" /* Offline */ === e);\\n        // Raise data from cache if we have any documents or we are offline\\n        }\\n    Cu(t) {\\n        // We don't need to handle includeDocumentMetadataChanges here because\\n        // the Metadata only changes have already been stripped out if needed.\\n        // At this point the only changes we will see are the ones we should\\n        // propagate.\\n        if (t.docChanges.length > 0) return !0;\\n        const e = this.Du && this.Du.hasPendingWrites !== t.hasPendingWrites;\\n        return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges;\\n        // Generally we should have hit one of the cases above, but it's possible\\n        // to get here if there were only metadata docChanges and they got\\n        // stripped out.\\n        }\\n    Nu(t) {\\n        t = xu.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Su = !0, \\n        this.vu.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A complete element in the bundle stream, together with the byte length it\\n * occupies in the stream.\\n */ class Uu {\\n    constructor(t, \\n    // How many bytes this element takes to store in the bundle.\\n    e) {\\n        this.payload = t, this.byteLength = e;\\n    }\\n    Mu() {\\n        return \\\"metadata\\\" in this.payload;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Helper to convert objects from bundles to model objects in the SDK.\\n */ class qu {\\n    constructor(t) {\\n        this.M = t;\\n    }\\n    wi(t) {\\n        return ps(this.M, t);\\n    }\\n    /**\\n     * Converts a BundleDocument to a MutableDocument.\\n     */    mi(t) {\\n        return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));\\n    }\\n    gi(t) {\\n        return ws(t);\\n    }\\n}\\n\\n/**\\n * A class to process the elements from a bundle, load them into local\\n * storage and provide progress update while loading.\\n */ class Ku {\\n    constructor(t, e, n) {\\n        this.Ou = t, this.localStore = e, this.M = n, \\n        /** Batched queries to be saved into storage */\\n        this.queries = [], \\n        /** Batched documents to be saved into storage */\\n        this.documents = [], \\n        /** The collection groups affected by this bundle. */\\n        this.collectionGroups = new Set, this.progress = Gu(t);\\n    }\\n    /**\\n     * Adds an element from the bundle to the loader.\\n     *\\n     * Returns a new progress if adding the element leads to a new progress,\\n     * otherwise returns null.\\n     */    Fu(t) {\\n        this.progress.bytesLoaded += t.byteLength;\\n        let e = this.progress.documentsLoaded;\\n        if (t.payload.namedQuery) this.queries.push(t.payload.namedQuery); else if (t.payload.documentMetadata) {\\n            this.documents.push({\\n                metadata: t.payload.documentMetadata\\n            }), t.payload.documentMetadata.exists || ++e;\\n            const n = _t.fromString(t.payload.documentMetadata.name);\\n            this.collectionGroups.add(n.get(n.length - 2));\\n        } else t.payload.document && (this.documents[this.documents.length - 1].document = t.payload.document, \\n        ++e);\\n        return e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e, \\n        Object.assign({}, this.progress)) : null;\\n    }\\n    $u(t) {\\n        const e = new Map, n = new qu(this.M);\\n        for (const s of t) if (s.metadata.queries) {\\n            const t = n.wi(s.metadata.name);\\n            for (const n of s.metadata.queries) {\\n                const s = (e.get(n) || Yn()).add(t);\\n                e.set(n, s);\\n            }\\n        }\\n        return e;\\n    }\\n    /**\\n     * Update the progress to 'Success' and return the updated progress.\\n     */    async complete() {\\n        const t = await mo(this.localStore, new qu(this.M), this.documents, this.Ou.id), e = this.$u(this.documents);\\n        for (const t of this.queries) await go(this.localStore, t, e.get(t.name));\\n        return this.progress.taskState = \\\"Success\\\", {\\n            progress: this.progress,\\n            Bu: this.collectionGroups,\\n            Lu: t\\n        };\\n    }\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\\n * loading a bundle.\\n */ function Gu(t) {\\n    return {\\n        taskState: \\\"Running\\\",\\n        documentsLoaded: 0,\\n        bytesLoaded: 0,\\n        totalDocuments: t.totalDocuments,\\n        totalBytes: t.totalBytes\\n    };\\n}\\n\\n/**\\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\\n * has succeeded.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nclass Qu {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\nclass ju {\\n    constructor(t) {\\n        this.key = t;\\n    }\\n}\\n\\n/**\\n * View is responsible for computing the final merged truth of what docs are in\\n * a query. It gets notified of local and remote changes to docs, and applies\\n * the query filters and limits to determine the most correct possible results.\\n */ class Wu {\\n    constructor(t, \\n    /** Documents included in the remote target */\\n    e) {\\n        this.query = t, this.Uu = e, this.qu = null, \\n        /**\\n         * A flag whether the view is current with the backend. A view is considered\\n         * current after it has seen the current flag from the backend and did not\\n         * lose consistency within the watch stream (e.g. because of an existence\\n         * filter mismatch).\\n         */\\n        this.current = !1, \\n        /** Documents in the view but not in the remote target */\\n        this.Ku = Yn(), \\n        /** Document Keys that have local changes */\\n        this.mutatedKeys = Yn(), this.Gu = nn(t), this.Qu = new Du(this.Gu);\\n    }\\n    /**\\n     * The set of remote documents that the server has told us belongs to the target associated with\\n     * this view.\\n     */    get ju() {\\n        return this.Uu;\\n    }\\n    /**\\n     * Iterates over a set of doc changes, applies the query limit, and computes\\n     * what the new results should be, what the changes were, and whether we may\\n     * need to go back to the local cache for more results. Does not make any\\n     * changes to the view.\\n     * @param docChanges - The doc changes to apply to this view.\\n     * @param previousChanges - If this is being called with a refill, then start\\n     *        with this set of docs and changes instead of the current view.\\n     * @returns a new set of docs, changes, and refill flag.\\n     */    Wu(t, e) {\\n        const n = e ? e.zu : new Cu, s = e ? e.Qu : this.Qu;\\n        let i = e ? e.mutatedKeys : this.mutatedKeys, r = s, o = !1;\\n        // Track the last doc in a (full) limit. This is necessary, because some\\n        // update (a delete, or an update moving a doc past the old limit) might\\n        // mean there is some other document in the local cache that either should\\n        // come (1) between the old last limit doc and the new last document, in the\\n        // case of updates, or (2) after the new last document, in the case of\\n        // deletes. So we keep this doc at the old limit to compare the updates to.\\n        // Note that this should never get used in a refill (when previousChanges is\\n        // set), because there will only be adds -- no deletes or updates.\\n        const u = \\\"F\\\" /* First */ === this.query.limitType && s.size === this.query.limit ? s.last() : null, a = \\\"L\\\" /* Last */ === this.query.limitType && s.size === this.query.limit ? s.first() : null;\\n        // Drop documents out to meet limit/limitToLast requirement.\\n        if (t.inorderTraversal(((t, e) => {\\n            const c = s.get(t), h = tn(this.query, e) ? e : null, l = !!c && this.mutatedKeys.has(c.key), f = !!h && (h.hasLocalMutations || \\n            // We only consider committed mutations for documents that were\\n            // mutated during the lifetime of the view.\\n            this.mutatedKeys.has(h.key) && h.hasCommittedMutations);\\n            let d = !1;\\n            // Calculate change\\n                        if (c && h) {\\n                c.data.isEqual(h.data) ? l !== f && (n.track({\\n                    type: 3 /* Metadata */ ,\\n                    doc: h\\n                }), d = !0) : this.Hu(c, h) || (n.track({\\n                    type: 2 /* Modified */ ,\\n                    doc: h\\n                }), d = !0, (u && this.Gu(h, u) > 0 || a && this.Gu(h, a) < 0) && (\\n                // This doc moved from inside the limit to outside the limit.\\n                // That means there may be some other doc in the local cache\\n                // that should be included instead.\\n                o = !0));\\n            } else !c && h ? (n.track({\\n                type: 0 /* Added */ ,\\n                doc: h\\n            }), d = !0) : c && !h && (n.track({\\n                type: 1 /* Removed */ ,\\n                doc: c\\n            }), d = !0, (u || a) && (\\n            // A doc was removed from a full limit query. We'll need to\\n            // requery from the local cache to see if we know about some other\\n            // doc that should be in the results.\\n            o = !0));\\n            d && (h ? (r = r.add(h), i = f ? i.add(t) : i.delete(t)) : (r = r.delete(t), i = i.delete(t)));\\n        })), null !== this.query.limit) for (;r.size > this.query.limit; ) {\\n            const t = \\\"F\\\" /* First */ === this.query.limitType ? r.last() : r.first();\\n            r = r.delete(t.key), i = i.delete(t.key), n.track({\\n                type: 1 /* Removed */ ,\\n                doc: t\\n            });\\n        }\\n        return {\\n            Qu: r,\\n            zu: n,\\n            ii: o,\\n            mutatedKeys: i\\n        };\\n    }\\n    Hu(t, e) {\\n        // We suppress the initial change event for documents that were modified as\\n        // part of a write acknowledgment (e.g. when the value of a server transform\\n        // is applied) as Watch will send us the same document again.\\n        // By suppressing the event, we only raise two user visible events (one with\\n        // `hasPendingWrites` and the final state of the document) instead of three\\n        // (one with `hasPendingWrites`, the modified document with\\n        // `hasPendingWrites` and the final state of the document).\\n        return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations;\\n    }\\n    /**\\n     * Updates the view with the given ViewDocumentChanges and optionally updates\\n     * limbo docs and sync state from the provided target change.\\n     * @param docChanges - The set of changes to make to the view's docs.\\n     * @param updateLimboDocuments - Whether to update limbo documents based on\\n     *        this change.\\n     * @param targetChange - A target change to apply for computing limbo docs and\\n     *        sync state.\\n     * @returns A new ViewChange with the given docs, changes, and sync state.\\n     */\\n    // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\\n    applyChanges(t, e, n) {\\n        const s = this.Qu;\\n        this.Qu = t.Qu, this.mutatedKeys = t.mutatedKeys;\\n        // Sort changes based on type and query comparator\\n        const i = t.zu.Au();\\n        i.sort(((t, e) => function(t, e) {\\n            const n = t => {\\n                switch (t) {\\n                  case 0 /* Added */ :\\n                    return 1;\\n\\n                  case 2 /* Modified */ :\\n                  case 3 /* Metadata */ :\\n                    // A metadata change is converted to a modified change at the public\\n                    // api layer.  Since we sort by document key and then change type,\\n                    // metadata and modified changes must be sorted equivalently.\\n                    return 2;\\n\\n                  case 1 /* Removed */ :\\n                    return 0;\\n\\n                  default:\\n                    return L();\\n                }\\n            };\\n            return n(t) - n(e);\\n        }\\n        /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t.type, e.type) || this.Gu(t.doc, e.doc))), this.Ju(n);\\n        const r = e ? this.Yu() : [], o = 0 === this.Ku.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = o !== this.qu;\\n        if (this.qu = o, 0 !== i.length || u) {\\n            return {\\n                snapshot: new xu(this.query, t.Qu, s, i, t.mutatedKeys, 0 /* Local */ === o, u, \\n                /* excludesMetadataChanges= */ !1),\\n                Xu: r\\n            };\\n        }\\n        // no changes\\n        return {\\n            Xu: r\\n        };\\n    }\\n    /**\\n     * Applies an OnlineState change to the view, potentially generating a\\n     * ViewChange if the view's syncState changes as a result.\\n     */    Pu(t) {\\n        return this.current && \\\"Offline\\\" /* Offline */ === t ? (\\n        // If we're offline, set `current` to false and then call applyChanges()\\n        // to refresh our syncState and generate a ViewChange as appropriate. We\\n        // are guaranteed to get a new TargetChange that sets `current` back to\\n        // true once the client is back online.\\n        this.current = !1, this.applyChanges({\\n            Qu: this.Qu,\\n            zu: new Cu,\\n            mutatedKeys: this.mutatedKeys,\\n            ii: !1\\n        }, \\n        /* updateLimboDocuments= */ !1)) : {\\n            Xu: []\\n        };\\n    }\\n    /**\\n     * Returns whether the doc for the given key should be in limbo.\\n     */    Zu(t) {\\n        // If the remote end says it's part of this query, it's not in limbo.\\n        return !this.Uu.has(t) && (\\n        // The local store doesn't think it's a result, so it shouldn't be in limbo.\\n        !!this.Qu.has(t) && !this.Qu.get(t).hasLocalMutations);\\n    }\\n    /**\\n     * Updates syncedDocuments, current, and limbo docs based on the given change.\\n     * Returns the list of changes to which docs are in limbo.\\n     */    Ju(t) {\\n        t && (t.addedDocuments.forEach((t => this.Uu = this.Uu.add(t))), t.modifiedDocuments.forEach((t => {})), \\n        t.removedDocuments.forEach((t => this.Uu = this.Uu.delete(t))), this.current = t.current);\\n    }\\n    Yu() {\\n        // We can only determine limbo documents when we're in-sync with the server.\\n        if (!this.current) return [];\\n        // TODO(klimt): Do this incrementally so that it's not quadratic when\\n        // updating many documents.\\n                const t = this.Ku;\\n        this.Ku = Yn(), this.Qu.forEach((t => {\\n            this.Zu(t.key) && (this.Ku = this.Ku.add(t.key));\\n        }));\\n        // Diff the new limbo docs with the old limbo docs.\\n        const e = [];\\n        return t.forEach((t => {\\n            this.Ku.has(t) || e.push(new ju(t));\\n        })), this.Ku.forEach((n => {\\n            t.has(n) || e.push(new Qu(n));\\n        })), e;\\n    }\\n    /**\\n     * Update the in-memory state of the current view with the state read from\\n     * persistence.\\n     *\\n     * We update the query view whenever a client's primary status changes:\\n     * - When a client transitions from primary to secondary, it can miss\\n     *   LocalStorage updates and its query views may temporarily not be\\n     *   synchronized with the state on disk.\\n     * - For secondary to primary transitions, the client needs to update the list\\n     *   of `syncedDocuments` since secondary clients update their query views\\n     *   based purely on synthesized RemoteEvents.\\n     *\\n     * @param queryResult.documents - The documents that match the query according\\n     * to the LocalStore.\\n     * @param queryResult.remoteKeys - The keys of the documents that match the\\n     * query according to the backend.\\n     *\\n     * @returns The ViewChange that resulted from this synchronization.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ta(t) {\\n        this.Uu = t._i, this.Ku = Yn();\\n        const e = this.Wu(t.documents);\\n        return this.applyChanges(e, /*updateLimboDocuments=*/ !0);\\n    }\\n    /**\\n     * Returns a view snapshot as if this query was just listened to. Contains\\n     * a document add for every existing document and the `fromCache` and\\n     * `hasPendingWrites` status of the already established view.\\n     */\\n    // PORTING NOTE: Multi-tab only.\\n    ea() {\\n        return xu.fromInitialDocuments(this.query, this.Qu, this.mutatedKeys, 0 /* Local */ === this.qu);\\n    }\\n}\\n\\n/**\\n * QueryView contains all of the data that SyncEngine needs to keep track of for\\n * a particular query.\\n */\\nclass zu {\\n    constructor(\\n    /**\\n     * The query itself.\\n     */\\n    t, \\n    /**\\n     * The target number created by the client that is used in the watch\\n     * stream to identify this query.\\n     */\\n    e, \\n    /**\\n     * The view is responsible for computing the final merged truth of what\\n     * docs are in the query. It gets notified of local and remote changes,\\n     * and applies the query filters and limits to determine the most correct\\n     * possible results.\\n     */\\n    n) {\\n        this.query = t, this.targetId = e, this.view = n;\\n    }\\n}\\n\\n/** Tracks a limbo resolution. */ class Hu {\\n    constructor(t) {\\n        this.key = t, \\n        /**\\n         * Set to true once we've received a document. This is used in\\n         * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\\n         * decide whether it needs to manufacture a delete event for the target once\\n         * the target is CURRENT.\\n         */\\n        this.na = !1;\\n    }\\n}\\n\\n/**\\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\\n *\\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\\n * registered individually. This is done in `syncEngineWrite()` and\\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\\n * serve as entry points to RemoteStore's functionality.\\n *\\n * Note: some field defined in this class might have public access level, but\\n * the class is not exported so they are only accessible from this module.\\n * This is useful to implement optional features (like bundles) in free\\n * functions, such that they are tree-shakeable.\\n */ class Ju {\\n    constructor(t, e, n, \\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n    s, i, r) {\\n        this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = s, \\n        this.currentUser = i, this.maxConcurrentLimboResolutions = r, this.sa = {}, this.ia = new Kn((t => Xe(t)), Ye), \\n        this.ra = new Map, \\n        /**\\n         * The keys of documents that are in limbo for which we haven't yet started a\\n         * limbo resolution query. The strings in this set are the result of calling\\n         * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\\n         *\\n         * The `Set` type was chosen because it provides efficient lookup and removal\\n         * of arbitrary elements and it also maintains insertion order, providing the\\n         * desired queue-like FIFO semantics.\\n         */\\n        this.oa = new Set, \\n        /**\\n         * Keeps track of the target ID for each document that is in limbo with an\\n         * active target.\\n         */\\n        this.ua = new fe(xt.comparator), \\n        /**\\n         * Keeps track of the information about an active limbo resolution for each\\n         * active target ID that was started for the purpose of limbo resolution.\\n         */\\n        this.aa = new Map, this.ca = new Io, \\n        /** Stores user completion handlers, indexed by User and BatchId. */\\n        this.ha = {}, \\n        /** Stores user callbacks waiting for all pending writes to be acknowledged. */\\n        this.la = new Map, this.fa = br.yn(), this.onlineState = \\\"Unknown\\\" /* Unknown */ , \\n        // The primary state is set to `true` or `false` immediately after Firestore\\n        // startup. In the interim, a client should only be considered primary if\\n        // `isPrimary` is true.\\n        this.da = void 0;\\n    }\\n    get isPrimaryClient() {\\n        return !0 === this.da;\\n    }\\n}\\n\\n/**\\n * Initiates the new listen, resolves promise when listen enqueued to the\\n * server. All the subsequent view snapshots or errors are sent to the\\n * subscribed handlers. Returns the initial snapshot.\\n */\\nasync function Yu(t, e) {\\n    const n = Pa(t);\\n    let s, i;\\n    const r = n.ia.get(e);\\n    if (r) \\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\\n    // already exists when EventManager calls us for the first time. This\\n    // happens when the primary tab is already listening to this query on\\n    // behalf of another tab and the user of the primary also starts listening\\n    // to the query. EventManager will not have an assigned target ID in this\\n    // case and calls `listen` to obtain this ID.\\n    s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.ea(); else {\\n        const t = await co(n.localStore, He(e));\\n        n.isPrimaryClient && nu(n.remoteStore, t);\\n        const r = n.sharedClientState.addLocalQueryTarget(t.targetId);\\n        s = t.targetId, i = await Xu(n, e, s, \\\"current\\\" === r);\\n    }\\n    return i;\\n}\\n\\n/**\\n * Registers a view for a previously unknown query and computes its initial\\n * snapshot.\\n */ async function Xu(t, e, n, s) {\\n    // PORTING NOTE: On Web only, we inject the code that registers new Limbo\\n    // targets based on view changes. This allows us to only depend on Limbo\\n    // changes when user code includes queries.\\n    t._a = (e, n, s) => async function(t, e, n, s) {\\n        let i = e.view.Wu(n);\\n        i.ii && (\\n        // The query has a limit and some docs were removed, so we need\\n        // to re-run the query against the local store to make sure we\\n        // didn't lose any good docs that had been past the limit.\\n        i = await lo(t.localStore, e.query, \\n        /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Wu(t, i))));\\n        const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i, \\n        /* updateLimboDocuments= */ t.isPrimaryClient, r);\\n        return la(t, e.targetId, o.Xu), o.snapshot;\\n    }(t, e, n, s);\\n    const i = await lo(t.localStore, e, \\n    /* usePreviousResults= */ !0), r = new Wu(e, i._i), o = r.Wu(i.documents), u = es.createSynthesizedTargetChangeForCurrentChange(n, s && \\\"Offline\\\" /* Offline */ !== t.onlineState), a = r.applyChanges(o, \\n    /* updateLimboDocuments= */ t.isPrimaryClient, u);\\n    la(t, n, a.Xu);\\n    const c = new zu(e, n, r);\\n    return t.ia.set(e, c), t.ra.has(n) ? t.ra.get(n).push(e) : t.ra.set(n, [ e ]), a.snapshot;\\n}\\n\\n/** Stops listening to the query. */ async function Zu(t, e) {\\n    const n = K(t), s = n.ia.get(e), i = n.ra.get(s.targetId);\\n    if (i.length > 1) return n.ra.set(s.targetId, i.filter((t => !Ye(t, e)))), void n.ia.delete(e);\\n    // No other queries are mapped to the target, clean up the query and the target.\\n        if (n.isPrimaryClient) {\\n        // We need to remove the local query target first to allow us to verify\\n        // whether any other client is still interested in this target.\\n        n.sharedClientState.removeLocalQueryTarget(s.targetId);\\n        n.sharedClientState.isActiveQueryTarget(s.targetId) || await ho(n.localStore, s.targetId, \\n        /*keepPersistedTargetData=*/ !1).then((() => {\\n            n.sharedClientState.clearQueryState(s.targetId), su(n.remoteStore, s.targetId), \\n            ca(n, s.targetId);\\n        })).catch(Dr);\\n    } else ca(n, s.targetId), await ho(n.localStore, s.targetId, \\n    /*keepPersistedTargetData=*/ !0);\\n}\\n\\n/**\\n * Initiates the write of local mutation batch which involves adding the\\n * writes to the mutation queue, notifying the remote store about new\\n * mutations and raising events for any changes this write caused.\\n *\\n * The promise returned by this call is resolved when the above steps\\n * have completed, *not* when the write was acked by the backend. The\\n * userCallback is resolved once the write was acked/rejected by the\\n * backend (or failed locally for any other reason).\\n */ async function ta(t, e, n) {\\n    const s = Va(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t), s = at.now(), i = e.reduce(((t, e) => t.add(e.key)), Yn());\\n            let r;\\n            return n.persistence.runTransaction(\\\"Locally write mutations\\\", \\\"readwrite\\\", (t => n.fi.Ks(t, i).next((i => {\\n                r = i;\\n                // For non-idempotent mutations (such as `FieldValue.increment()`),\\n                // we record the base state in a separate patch mutation. This is\\n                // later used to guarantee consistent values and prevents flicker\\n                // even if the backend sends us an update that already includes our\\n                // transform.\\n                const o = [];\\n                for (const t of e) {\\n                    const e = vn(t, r.get(t.key));\\n                    null != e && \\n                    // NOTE: The base state should only be applied if there's some\\n                    // existing document to override, so use a Precondition of\\n                    // exists=true\\n                    o.push(new xn(t.key, e, ee(e.value.mapValue), An.exists(!0)));\\n                }\\n                return n.Bs.addMutationBatch(t, s, o, e);\\n            })))).then((t => (t.applyToLocalDocumentSet(r), {\\n                batchId: t.batchId,\\n                changes: r\\n            })));\\n        }(s.localStore, e);\\n        s.sharedClientState.addPendingMutation(t.batchId), function(t, e, n) {\\n            let s = t.ha[t.currentUser.toKey()];\\n            s || (s = new fe(rt));\\n            s = s.insert(e, n), t.ha[t.currentUser.toKey()] = s;\\n        }\\n        /**\\n * Resolves or rejects the user callback for the given batch and then discards\\n * it.\\n */ (s, t.batchId, n), await _a(s, t.changes), await wu(s.remoteStore);\\n    } catch (t) {\\n        // If we can't persist the mutation, we reject the user callback and\\n        // don't send the mutation. The user can then retry the write.\\n        const e = Su(t, \\\"Failed to persist write\\\");\\n        n.reject(e);\\n    }\\n}\\n\\n/**\\n * Applies one remote event to the sync engine, notifying any views of the\\n * changes, and releasing any pending mutation batches that would become\\n * visible because of the snapshot version the remote event contains.\\n */ async function ea(t, e) {\\n    const n = K(t);\\n    try {\\n        const t = await oo(n.localStore, e);\\n        // Update `receivedDocument` as appropriate for any limbo targets.\\n                e.targetChanges.forEach(((t, e) => {\\n            const s = n.aa.get(e);\\n            s && (\\n            // Since this is a limbo resolution lookup, it's for a single document\\n            // and it could be added, modified, or removed, but not a combination.\\n            U(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), \\n            t.addedDocuments.size > 0 ? s.na = !0 : t.modifiedDocuments.size > 0 ? U(s.na) : t.removedDocuments.size > 0 && (U(s.na), \\n            s.na = !1));\\n        })), await _a(n, t, e);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\n/**\\n * Applies an OnlineState change to the sync engine and notifies any views of\\n * the change.\\n */ function na(t, e, n) {\\n    const s = K(t);\\n    // If we are the secondary client, we explicitly ignore the remote store's\\n    // online state (the local client may go offline, even though the primary\\n    // tab remains online) and only apply the primary tab's online state from\\n    // SharedClientState.\\n        if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {\\n        const t = [];\\n        s.ia.forEach(((n, s) => {\\n            const i = s.view.Pu(e);\\n            i.snapshot && t.push(i.snapshot);\\n        })), function(t, e) {\\n            const n = K(t);\\n            n.onlineState = e;\\n            let s = !1;\\n            n.queries.forEach(((t, n) => {\\n                for (const t of n.listeners) \\n                // Run global snapshot listeners if a consistent snapshot has been emitted.\\n                t.Pu(e) && (s = !0);\\n            })), s && Bu(n);\\n        }(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);\\n    }\\n}\\n\\n/**\\n * Rejects the listen for the given targetID. This can be triggered by the\\n * backend for any active target.\\n *\\n * @param syncEngine - The sync engine implementation.\\n * @param targetId - The targetID corresponds to one previously initiated by the\\n * user as part of TargetData passed to listen() on RemoteStore.\\n * @param err - A description of the condition that has forced the rejection.\\n * Nearly always this will be an indication that the user is no longer\\n * authorized to see the data matching the target.\\n */ async function sa(t, e, n) {\\n    const s = K(t);\\n    // PORTING NOTE: Multi-tab only.\\n        s.sharedClientState.updateQueryState(e, \\\"rejected\\\", n);\\n    const i = s.aa.get(e), r = i && i.key;\\n    if (r) {\\n        // TODO(klimt): We really only should do the following on permission\\n        // denied errors, but we don't have the cause code here.\\n        // It's a limbo doc. Create a synthetic event saying it was deleted.\\n        // This is kind of a hack. Ideally, we would have a method in the local\\n        // store to purge a document. However, it would be tricky to keep all of\\n        // the local store's invariants with another method.\\n        let t = new fe(xt.comparator);\\n        // TODO(b/217189216): This limbo document should ideally have a read time,\\n        // so that it is picked up by any read-time based scans. The backend,\\n        // however, does not send a read time for target removals.\\n                t = t.insert(r, ne.newNoDocument(r, ct.min()));\\n        const n = Yn().add(r), i = new ts(ct.min(), \\n        /* targetChanges= */ new Map, \\n        /* targetMismatches= */ new we(rt), t, n);\\n        await ea(s, i), \\n        // Since this query failed, we won't want to manually unlisten to it.\\n        // We only remove it from bookkeeping after we successfully applied the\\n        // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\\n        // this query when the RemoteStore restarts the Watch stream, which should\\n        // re-trigger the target failure.\\n        s.ua = s.ua.remove(r), s.aa.delete(e), da(s);\\n    } else await ho(s.localStore, e, \\n    /* keepPersistedTargetData */ !1).then((() => ca(s, e, n))).catch(Dr);\\n}\\n\\nasync function ia(t, e) {\\n    const n = K(t), s = e.batch.batchId;\\n    try {\\n        const t = await io(n.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught\\n        // up), so we raise user callbacks first so that they consistently happen\\n        // before listen events.\\n                aa(n, s, /*error=*/ null), ua(n, s), n.sharedClientState.updateMutationState(s, \\\"acknowledged\\\"), \\n        await _a(n, t);\\n    } catch (t) {\\n        await Dr(t);\\n    }\\n}\\n\\nasync function ra(t, e, n) {\\n    const s = K(t);\\n    try {\\n        const t = await function(t, e) {\\n            const n = K(t);\\n            return n.persistence.runTransaction(\\\"Reject batch\\\", \\\"readwrite-primary\\\", (t => {\\n                let s;\\n                return n.Bs.lookupMutationBatch(t, e).next((e => (U(null !== e), s = e.keys(), n.Bs.removeMutationBatch(t, e)))).next((() => n.Bs.performConsistencyCheck(t))).next((() => n.fi.Ks(t, s)));\\n            }));\\n        }\\n        /**\\n * Returns the largest (latest) batch id in mutation queue that is pending\\n * server response.\\n *\\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\\n */ (s.localStore, e);\\n        // The local store may or may not be able to apply the write result and\\n        // raise events immediately (depending on whether the watcher is caught up),\\n        // so we raise user callbacks first so that they consistently happen before\\n        // listen events.\\n                aa(s, e, n), ua(s, e), s.sharedClientState.updateMutationState(e, \\\"rejected\\\", n), \\n        await _a(s, t);\\n    } catch (n) {\\n        await Dr(n);\\n    }\\n}\\n\\n/**\\n * Registers a user callback that resolves when all pending mutations at the moment of calling\\n * are acknowledged .\\n */ async function oa(t, e) {\\n    const n = K(t);\\n    au(n.remoteStore) || O(\\\"SyncEngine\\\", \\\"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.\\\");\\n    try {\\n        const t = await function(t) {\\n            const e = K(t);\\n            return e.persistence.runTransaction(\\\"Get highest unacknowledged batch id\\\", \\\"readonly\\\", (t => e.Bs.getHighestUnacknowledgedBatchId(t)));\\n        }(n.localStore);\\n        if (-1 === t) \\n        // Trigger the callback right away if there is no pending writes at the moment.\\n        return void e.resolve();\\n        const s = n.la.get(t) || [];\\n        s.push(e), n.la.set(t, s);\\n    } catch (t) {\\n        const n = Su(t, \\\"Initialization of waitForPendingWrites() operation failed\\\");\\n        e.reject(n);\\n    }\\n}\\n\\n/**\\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\\n * if there are any.\\n */ function ua(t, e) {\\n    (t.la.get(e) || []).forEach((t => {\\n        t.resolve();\\n    })), t.la.delete(e);\\n}\\n\\n/** Reject all outstanding callbacks waiting for pending writes to complete. */ function aa(t, e, n) {\\n    const s = K(t);\\n    let i = s.ha[s.currentUser.toKey()];\\n    // NOTE: Mutations restored from persistence won't have callbacks, so it's\\n    // okay for there to be no callback for this ID.\\n        if (i) {\\n        const t = i.get(e);\\n        t && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), s.ha[s.currentUser.toKey()] = i;\\n    }\\n}\\n\\nfunction ca(t, e, n = null) {\\n    t.sharedClientState.removeLocalQueryTarget(e);\\n    for (const s of t.ra.get(e)) t.ia.delete(s), n && t.sa.wa(s, n);\\n    if (t.ra.delete(e), t.isPrimaryClient) {\\n        t.ca.vi(e).forEach((e => {\\n            t.ca.containsKey(e) || \\n            // We removed the last reference for this key\\n            ha(t, e);\\n        }));\\n    }\\n}\\n\\nfunction ha(t, e) {\\n    t.oa.delete(e.path.canonicalString());\\n    // It's possible that the target already got removed because the query failed. In that case,\\n    // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\\n    const n = t.ua.get(e);\\n    null !== n && (su(t.remoteStore, n), t.ua = t.ua.remove(e), t.aa.delete(n), da(t));\\n}\\n\\nfunction la(t, e, n) {\\n    for (const s of n) if (s instanceof Qu) t.ca.addReference(s.key, e), fa(t, s); else if (s instanceof ju) {\\n        O(\\\"SyncEngine\\\", \\\"Document no longer in limbo: \\\" + s.key), t.ca.removeReference(s.key, e);\\n        t.ca.containsKey(s.key) || \\n        // We removed the last reference for this key\\n        ha(t, s.key);\\n    } else L();\\n}\\n\\nfunction fa(t, e) {\\n    const n = e.key, s = n.path.canonicalString();\\n    t.ua.get(n) || t.oa.has(s) || (O(\\\"SyncEngine\\\", \\\"New document in limbo: \\\" + n), t.oa.add(s), \\n    da(t));\\n}\\n\\n/**\\n * Starts listens for documents in limbo that are enqueued for resolution,\\n * subject to a maximum number of concurrent resolutions.\\n *\\n * Without bounding the number of concurrent resolutions, the server can fail\\n * with \\\"resource exhausted\\\" errors which can lead to pathological client\\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\\n */ function da(t) {\\n    for (;t.oa.size > 0 && t.ua.size < t.maxConcurrentLimboResolutions; ) {\\n        const e = t.oa.values().next().value;\\n        t.oa.delete(e);\\n        const n = new xt(_t.fromString(e)), s = t.fa.next();\\n        t.aa.set(s, new Hu(n)), t.ua = t.ua.insert(n, s), nu(t.remoteStore, new Ni(He(Ke(n.path)), s, 2 /* LimboResolution */ , nt.A));\\n    }\\n}\\n\\nasync function _a(t, e, n) {\\n    const s = K(t), i = [], r = [], o = [];\\n    s.ia.isEmpty() || (s.ia.forEach(((t, u) => {\\n        o.push(s._a(u, e, n).then((t => {\\n            if (t) {\\n                s.isPrimaryClient && s.sharedClientState.updateQueryState(u.targetId, t.fromCache ? \\\"not-current\\\" : \\\"current\\\"), \\n                i.push(t);\\n                const e = Zr.Ys(u.targetId, t);\\n                r.push(e);\\n            }\\n        })));\\n    })), await Promise.all(o), s.sa.zo(i), await async function(t, e) {\\n        const n = K(t);\\n        try {\\n            await n.persistence.runTransaction(\\\"notifyLocalViewChanges\\\", \\\"readwrite\\\", (t => yi.forEach(e, (e => yi.forEach(e.Hs, (s => n.persistence.referenceDelegate.addReference(t, e.targetId, s))).next((() => yi.forEach(e.Js, (s => n.persistence.referenceDelegate.removeReference(t, e.targetId, s)))))))));\\n        } catch (t) {\\n            if (!Ai(t)) throw t;\\n            // If `notifyLocalViewChanges` fails, we did not advance the sequence\\n            // number for the documents that were included in this transaction.\\n            // This might trigger them to be deleted earlier than they otherwise\\n            // would have, but it should not invalidate the integrity of the data.\\n            O(\\\"LocalStore\\\", \\\"Failed to update sequence numbers: \\\" + t);\\n        }\\n        for (const t of e) {\\n            const e = t.targetId;\\n            if (!t.fromCache) {\\n                const t = n.ui.get(e), s = t.snapshotVersion, i = t.withLastLimboFreeSnapshotVersion(s);\\n                // Advance the last limbo free snapshot version\\n                                n.ui = n.ui.insert(e, i);\\n            }\\n        }\\n    }(s.localStore, r));\\n}\\n\\nasync function wa(t, e) {\\n    const n = K(t);\\n    if (!n.currentUser.isEqual(e)) {\\n        O(\\\"SyncEngine\\\", \\\"User change. New user:\\\", e.toKey());\\n        const t = await so(n.localStore, e);\\n        n.currentUser = e, \\n        // Fails tasks waiting for pending writes requested by previous user.\\n        function(t, e) {\\n            t.la.forEach((t => {\\n                t.forEach((t => {\\n                    t.reject(new Q(G.CANCELLED, e));\\n                }));\\n            })), t.la.clear();\\n        }(n, \\\"'waitForPendingWrites' promise is rejected due to a user change.\\\"), \\n        // TODO(b/114226417): Consider calling this only in the primary tab.\\n        n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await _a(n, t.di);\\n    }\\n}\\n\\nfunction ma(t, e) {\\n    const n = K(t), s = n.aa.get(e);\\n    if (s && s.na) return Yn().add(s.key);\\n    {\\n        let t = Yn();\\n        const s = n.ra.get(e);\\n        if (!s) return t;\\n        for (const e of s) {\\n            const s = n.ia.get(e);\\n            t = t.unionWith(s.view.ju);\\n        }\\n        return t;\\n    }\\n}\\n\\n/**\\n * Reconcile the list of synced documents in an existing view with those\\n * from persistence.\\n */ async function ga(t, e) {\\n    const n = K(t), s = await lo(n.localStore, e.query, \\n    /* usePreviousResults= */ !0), i = e.view.ta(s);\\n    return n.isPrimaryClient && la(n, e.targetId, i.Xu), i;\\n}\\n\\n/**\\n * Retrieves newly changed documents from remote document cache and raises\\n * snapshots if needed.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nasync function ya(t, e) {\\n    const n = K(t);\\n    return _o(n.localStore, e).then((t => _a(n, t)));\\n}\\n\\n/** Applies a mutation state to an existing batch.  */\\n// PORTING NOTE: Multi-Tab only.\\nasync function pa(t, e, n, s) {\\n    const i = K(t), r = await function(t, e) {\\n        const n = K(t), s = K(n.Bs);\\n        return n.persistence.runTransaction(\\\"Lookup mutation documents\\\", \\\"readonly\\\", (t => s.fn(t, e).next((e => e ? n.fi.Ks(t, e) : yi.resolve(null)))));\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e);\\n    null !== r ? (\\\"pending\\\" === n ? \\n    // If we are the primary client, we need to send this write to the\\n    // backend. Secondary clients will ignore these writes since their remote\\n    // connection is disabled.\\n    await wu(i.remoteStore) : \\\"acknowledged\\\" === n || \\\"rejected\\\" === n ? (\\n    // NOTE: Both these methods are no-ops for batches that originated from\\n    // other clients.\\n    aa(i, e, s || null), ua(i, e), function(t, e) {\\n        K(K(t).Bs)._n(e);\\n    }\\n    // PORTING NOTE: Multi-Tab only.\\n    (i.localStore, e)) : L(), await _a(i, r)) : \\n    // A throttled tab may not have seen the mutation before it was completed\\n    // and removed from the mutation queue, in which case we won't have cached\\n    // the affected documents. In this case we can safely ignore the update\\n    // since that means we didn't apply the mutation locally at all (if we\\n    // had, we would have cached the affected documents), and so we will just\\n    // see any resulting document changes via normal remote document updates\\n    // as applicable.\\n    O(\\\"SyncEngine\\\", \\\"Cannot apply mutation batch with id: \\\" + e);\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ia(t, e) {\\n    const n = K(t);\\n    if (Pa(n), Va(n), !0 === e && !0 !== n.da) {\\n        // Secondary tabs only maintain Views for their local listeners and the\\n        // Views internal state may not be 100% populated (in particular\\n        // secondary tabs don't track syncedDocuments, the set of documents the\\n        // server considers to be in the target). So when a secondary becomes\\n        // primary, we need to need to make sure that all views for all targets\\n        // match the state on disk.\\n        const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());\\n        n.da = !0, await bu(n.remoteStore, !0);\\n        for (const t of e) nu(n.remoteStore, t);\\n    } else if (!1 === e && !1 !== n.da) {\\n        const t = [];\\n        let e = Promise.resolve();\\n        n.ra.forEach(((s, i) => {\\n            n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (ca(n, i), \\n            ho(n.localStore, i, \\n            /*keepPersistedTargetData=*/ !0)))), su(n.remoteStore, i);\\n        })), await e, await Ta(n, t), \\n        // PORTING NOTE: Multi-Tab only.\\n        function(t) {\\n            const e = K(t);\\n            e.aa.forEach(((t, n) => {\\n                su(e.remoteStore, n);\\n            })), e.ca.Si(), e.aa = new Map, e.ua = new fe(xt.comparator);\\n        }\\n        /**\\n * Reconcile the query views of the provided query targets with the state from\\n * persistence. Raises snapshots for any changes that affect the local\\n * client and returns the updated state of all target's query data.\\n *\\n * @param syncEngine - The sync engine implementation\\n * @param targets - the list of targets with views that need to be recomputed\\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\\n * tab to a primary tab\\n */\\n        // PORTING NOTE: Multi-Tab only.\\n        (n), n.da = !1, await bu(n.remoteStore, !1);\\n    }\\n}\\n\\nasync function Ta(t, e, n) {\\n    const s = K(t), i = [], r = [];\\n    for (const t of e) {\\n        let e;\\n        const n = s.ra.get(t);\\n        if (n && 0 !== n.length) {\\n            // For queries that have a local View, we fetch their current state\\n            // from LocalStore (as the resume token and the snapshot version\\n            // might have changed) and reconcile their views with the persisted\\n            // state (the list of syncedDocuments may have gotten out of sync).\\n            e = await co(s.localStore, He(n[0]));\\n            for (const t of n) {\\n                const e = s.ia.get(t), n = await ga(s, e);\\n                n.snapshot && r.push(n.snapshot);\\n            }\\n        } else {\\n            // For queries that never executed on this client, we need to\\n            // allocate the target in LocalStore and initialize a new View.\\n            const n = await fo(s.localStore, t);\\n            e = await co(s.localStore, n), await Xu(s, Ea(n), t, \\n            /*current=*/ !1);\\n        }\\n        i.push(e);\\n    }\\n    return s.sa.zo(r), i;\\n}\\n\\n/**\\n * Creates a `Query` object from the specified `Target`. There is no way to\\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\\n * object.\\n *\\n * The synthesized result might be different from the original `Query`, but\\n * since the synthesized `Query` should return the same results as the\\n * original one (only the presentation of results might differ), the potential\\n * difference will not cause issues.\\n */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Ea(t) {\\n    return qe(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \\\"F\\\" /* First */ , t.startAt, t.endAt);\\n}\\n\\n/** Returns the IDs of the clients that are currently active. */\\n// PORTING NOTE: Multi-Tab only.\\nfunction Aa(t) {\\n    const e = K(t);\\n    return K(K(e.localStore).persistence).Fs();\\n}\\n\\n/** Applies a query target change from a different tab. */\\n// PORTING NOTE: Multi-Tab only.\\nasync function Ra(t, e, n, s) {\\n    const i = K(t);\\n    if (i.da) \\n    // If we receive a target state notification via WebStorage, we are\\n    // either already secondary or another tab has taken the primary lease.\\n    return void O(\\\"SyncEngine\\\", \\\"Ignoring unexpected query state notification.\\\");\\n    const r = i.ra.get(e);\\n    if (r && r.length > 0) switch (n) {\\n      case \\\"current\\\":\\n      case \\\"not-current\\\":\\n        {\\n            const t = await _o(i.localStore, en(r[0])), s = ts.createSynthesizedRemoteEventForCurrentChange(e, \\\"current\\\" === n);\\n            await _a(i, t, s);\\n            break;\\n        }\\n\\n      case \\\"rejected\\\":\\n        await ho(i.localStore, e, \\n        /* keepPersistedTargetData */ !0), ca(i, e, s);\\n        break;\\n\\n      default:\\n        L();\\n    }\\n}\\n\\n/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {\\n    const s = Pa(t);\\n    if (s.da) {\\n        for (const t of e) {\\n            if (s.ra.has(t)) {\\n                // A target might have been added in a previous attempt\\n                O(\\\"SyncEngine\\\", \\\"Adding an already active target \\\" + t);\\n                continue;\\n            }\\n            const e = await fo(s.localStore, t), n = await co(s.localStore, e);\\n            await Xu(s, Ea(e), n.targetId, \\n            /*current=*/ !1), nu(s.remoteStore, n);\\n        }\\n        for (const t of n) \\n        // Check that the target is still active since the target might have been\\n        // removed if it has been rejected by the backend.\\n        s.ra.has(t) && \\n        // Release queries that are still active.\\n        await ho(s.localStore, t, \\n        /* keepPersistedTargetData */ !1).then((() => {\\n            su(s.remoteStore, t), ca(s, t);\\n        })).catch(Dr);\\n    }\\n}\\n\\nfunction Pa(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e), \\n    e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager), \\n    e.sa.wa = $u.bind(null, e.eventManager), e;\\n}\\n\\nfunction Va(t) {\\n    const e = K(t);\\n    return e.remoteStore.remoteSyncer.applySuccessfulWrite = ia.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ra.bind(null, e), \\n    e;\\n}\\n\\n/**\\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\\n * the bundle finished loading.\\n *\\n * @param syncEngine - SyncEngine to use.\\n * @param bundleReader - Bundle to load into the SDK.\\n * @param task - LoadBundleTask used to update the loading progress to public API.\\n */ function va(t, e, n) {\\n    const s = K(t);\\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        (\\n    /** Loads a bundle and returns the list of affected collection groups. */\\n    async function(t, e, n) {\\n        try {\\n            const s = await e.getMetadata();\\n            if (await function(t, e) {\\n                const n = K(t), s = ws(e.createTime);\\n                return n.persistence.runTransaction(\\\"hasNewerBundle\\\", \\\"readonly\\\", (t => n._s.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));\\n            }\\n            /**\\n * Saves the given `BundleMetadata` to local persistence.\\n */ (t.localStore, s)) return await e.close(), n._completeWith(function(t) {\\n                return {\\n                    taskState: \\\"Success\\\",\\n                    documentsLoaded: t.totalDocuments,\\n                    bytesLoaded: t.totalBytes,\\n                    totalDocuments: t.totalDocuments,\\n                    totalBytes: t.totalBytes\\n                };\\n            }(s)), Promise.resolve(new Set);\\n            n._updateProgress(Gu(s));\\n            const i = new Ku(s, t.localStore, e.M);\\n            let r = await e.ma();\\n            for (;r; ) {\\n                const t = await i.Fu(r);\\n                t && n._updateProgress(t), r = await e.ma();\\n            }\\n            const o = await i.complete();\\n            return await _a(t, o.Lu, \\n            /* remoteEvent */ void 0), \\n            // Save metadata, so loading the same bundle will skip.\\n            await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"Save bundle\\\", \\\"readwrite\\\", (t => n._s.saveBundleMetadata(t, e)));\\n            }\\n            /**\\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\\n * resolves to undefined if no persisted data can be found.\\n */ (t.localStore, s), n._completeWith(o.progress), Promise.resolve(o.Bu);\\n        } catch (t) {\\n            return $(\\\"SyncEngine\\\", `Loading bundle failed with ${t}`), n._failWith(t), Promise.resolve(new Set);\\n        }\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Provides all components needed for Firestore with in-memory persistence.\\n * Uses EagerGC garbage collection.\\n */)(s, e, n).then((t => {\\n        s.sharedClientState.notifyBundleLoaded(t);\\n    }));\\n}\\n\\nclass Sa {\\n    constructor() {\\n        this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        this.M = jo(t.databaseInfo.databaseId), this.sharedClientState = this.ga(t), this.persistence = this.ya(t), \\n        await this.persistence.start(), this.gcScheduler = this.pa(t), this.localStore = this.Ia(t);\\n    }\\n    pa(t) {\\n        return null;\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    ya(t) {\\n        return new Po(vo.Yi, this.M);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n    async terminate() {\\n        this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(), \\n        await this.persistence.shutdown();\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with IndexedDB persistence.\\n */ class Da extends Sa {\\n    constructor(t, e, n) {\\n        super(), this.Ta = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t), await this.Ta.initialize(this, t), \\n        // Enqueue writes from a previous session\\n        await Va(this.Ta.syncEngine), await wu(this.Ta.remoteStore), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore), \\n        Promise.resolve())));\\n    }\\n    Ia(t) {\\n        return no(this.persistence, new to, t.initialUser, this.M);\\n    }\\n    pa(t) {\\n        const e = this.persistence.referenceDelegate.garbageCollector;\\n        return new Nr(e, t.asyncQueue);\\n    }\\n    ya(t) {\\n        const e = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), n = void 0 !== this.cacheSizeBytes ? gr.withCacheSize(this.cacheSizeBytes) : gr.DEFAULT;\\n        return new zr(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, Go(), Qo(), this.M, this.sharedClientState, !!this.forceOwnership);\\n    }\\n    ga(t) {\\n        return new $o;\\n    }\\n}\\n\\n/**\\n * Provides all components needed for Firestore with multi-tab IndexedDB\\n * persistence.\\n *\\n * In the legacy client, this provider is used to provide both multi-tab and\\n * non-multi-tab persistence since we cannot tell at build time whether\\n * `synchronizeTabs` will be enabled.\\n */ class Ca extends Da {\\n    constructor(t, e) {\\n        super(t, e, /* forceOwnership= */ !1), this.Ta = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;\\n    }\\n    async initialize(t) {\\n        await super.initialize(t);\\n        const e = this.Ta.syncEngine;\\n        this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {\\n            $r: pa.bind(null, e),\\n            Br: Ra.bind(null, e),\\n            Lr: ba.bind(null, e),\\n            Fs: Aa.bind(null, e),\\n            Fr: ya.bind(null, e)\\n        }, await this.sharedClientState.start()), \\n        // NOTE: This will immediately call the listener, so we make sure to\\n        // set it after localStore / remoteStore are started.\\n        await this.persistence.Ts((async t => {\\n            await Ia(this.Ta.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());\\n        }));\\n    }\\n    ga(t) {\\n        const e = Go();\\n        if (!Fo.vt(e)) throw new Q(G.UNIMPLEMENTED, \\\"IndexedDB persistence is only available on platforms that support LocalStorage.\\\");\\n        const n = Yr(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);\\n        return new Fo(e, t.asyncQueue, n, t.clientId, t.initialUser);\\n    }\\n}\\n\\n/**\\n * Initializes and wires the components that are needed to interface with the\\n * network.\\n */ class xa {\\n    async initialize(t, e) {\\n        this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState, \\n        this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e), \\n        this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e, \\n        /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */), \\n        this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine), \\n        await bu(this.remoteStore, this.syncEngine.isPrimaryClient));\\n    }\\n    createEventManager(t) {\\n        return new ku;\\n    }\\n    createDatastore(t) {\\n        const e = jo(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new Ko(s));\\n        var s;\\n        /** Return the Platform-specific connectivity monitor. */        return function(t, e, n, s) {\\n            return new Yo(t, e, n, s);\\n        }(t.authCredentials, t.appCheckCredentials, n, e);\\n    }\\n    createRemoteStore(t) {\\n        return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => na(this.syncEngine, t, 0 /* RemoteStore */), \\n        r = Lo.vt() ? new Lo : new Bo, new Zo(e, n, s, i, r);\\n        var e, n, s, i, r;\\n        /** Re-enables the network. Idempotent. */    }\\n    createSyncEngine(t, e) {\\n        return function(t, e, n, \\n        // PORTING NOTE: Manages state synchronization in multi-tab environments.\\n        s, i, r, o) {\\n            const u = new Ju(t, e, n, s, i, r);\\n            return o && (u.da = !0), u;\\n        }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);\\n    }\\n    terminate() {\\n        return async function(t) {\\n            const e = K(t);\\n            O(\\\"RemoteStore\\\", \\\"RemoteStore shutting down.\\\"), e.wu.add(5 /* Shutdown */), await eu(e), \\n            e.gu.shutdown(), \\n            // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\\n            // triggering spurious listener events with cached data, etc.\\n            e.yu.set(\\\"Unknown\\\" /* Unknown */);\\n        }(this.remoteStore);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * How many bytes to read each time when `ReadableStreamReader.read()` is\\n * called. Only applicable for byte streams that we control (e.g. those backed\\n * by an UInt8Array).\\n */\\n/**\\n * Builds a `ByteStreamReader` from a UInt8Array.\\n * @param source - The data source to use.\\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\\n *        will read.\\n */\\nfunction Na(t, e = 10240) {\\n    let n = 0;\\n    // The TypeScript definition for ReadableStreamReader changed. We use\\n    // `any` here to allow this code to compile with different versions.\\n    // See https://github.com/microsoft/TypeScript/issues/42970\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        return {\\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n        async read() {\\n            if (n < t.byteLength) {\\n                const s = {\\n                    value: t.slice(n, n + e),\\n                    done: !1\\n                };\\n                return n += e, s;\\n            }\\n            return {\\n                done: !0\\n            };\\n        },\\n        async cancel() {},\\n        releaseLock() {},\\n        closed: Promise.reject(\\\"unimplemented\\\")\\n    };\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/*\\n * A wrapper implementation of Observer<T> that will dispatch events\\n * asynchronously. To allow immediate silencing, a mute call is added which\\n * causes events scheduled to no longer be raised.\\n */\\nclass ka {\\n    constructor(t) {\\n        this.observer = t, \\n        /**\\n         * When set to true, will not raise future events. Necessary to deal with\\n         * async detachment of listener.\\n         */\\n        this.muted = !1;\\n    }\\n    next(t) {\\n        this.observer.next && this.Ea(this.observer.next, t);\\n    }\\n    error(t) {\\n        this.observer.error ? this.Ea(this.observer.error, t) : console.error(\\\"Uncaught Error in snapshot listener:\\\", t);\\n    }\\n    Aa() {\\n        this.muted = !0;\\n    }\\n    Ea(t, e) {\\n        this.muted || setTimeout((() => {\\n            this.muted || t(e);\\n        }), 0);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A class representing a bundle.\\n *\\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\\n * elements out of the underlying content.\\n */ class Ma {\\n    constructor(\\n    /** The reader to read from underlying binary bundle data source. */\\n    t, e) {\\n        this.Ra = t, this.M = e, \\n        /** Cached bundle metadata. */\\n        this.metadata = new j, \\n        /**\\n         * Internal buffer to hold bundle content, accumulating incomplete element\\n         * content.\\n         */\\n        this.buffer = new Uint8Array, this.ba = new TextDecoder(\\\"utf-8\\\"), \\n        // Read the metadata (which is the first element).\\n        this.Pa().then((t => {\\n            t && t.Mu() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\\\\n             ${JSON.stringify(null == t ? void 0 : t.payload)}`));\\n        }), (t => this.metadata.reject(t)));\\n    }\\n    close() {\\n        return this.Ra.cancel();\\n    }\\n    async getMetadata() {\\n        return this.metadata.promise;\\n    }\\n    async ma() {\\n        // Makes sure metadata is read before proceeding.\\n        return await this.getMetadata(), this.Pa();\\n    }\\n    /**\\n     * Reads from the head of internal buffer, and pulling more data from\\n     * underlying stream if a complete element cannot be found, until an\\n     * element(including the prefixed length and the JSON string) is found.\\n     *\\n     * Once a complete element is read, it is dropped from internal buffer.\\n     *\\n     * Returns either the bundled element, or null if we have reached the end of\\n     * the stream.\\n     */    async Pa() {\\n        const t = await this.Va();\\n        if (null === t) return null;\\n        const e = this.ba.decode(t), n = Number(e);\\n        isNaN(n) && this.va(`length string (${e}) is not valid number`);\\n        const s = await this.Sa(n);\\n        return new Uu(JSON.parse(s), t.length + n);\\n    }\\n    /** First index of '{' from the underlying buffer. */    Da() {\\n        return this.buffer.findIndex((t => t === \\\"{\\\".charCodeAt(0)));\\n    }\\n    /**\\n     * Reads from the beginning of the internal buffer, until the first '{', and\\n     * return the content.\\n     *\\n     * If reached end of the stream, returns a null.\\n     */    async Va() {\\n        for (;this.Da() < 0; ) {\\n            if (await this.Ca()) break;\\n        }\\n        // Broke out of the loop because underlying stream is closed, and there\\n        // happens to be no more data to process.\\n                if (0 === this.buffer.length) return null;\\n        const t = this.Da();\\n        // Broke out of the loop because underlying stream is closed, but still\\n        // cannot find an open bracket.\\n                t < 0 && this.va(\\\"Reached the end of bundle when a length string is expected.\\\");\\n        const e = this.buffer.slice(0, t);\\n        // Update the internal buffer to drop the read length.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    /**\\n     * Reads from a specified position from the internal buffer, for a specified\\n     * number of bytes, pulling more data from the underlying stream if needed.\\n     *\\n     * Returns a string decoded from the read bytes.\\n     */    async Sa(t) {\\n        for (;this.buffer.length < t; ) {\\n            await this.Ca() && this.va(\\\"Reached the end of bundle when more is expected.\\\");\\n        }\\n        const e = this.ba.decode(this.buffer.slice(0, t));\\n        // Update the internal buffer to drop the read json string.\\n                return this.buffer = this.buffer.slice(t), e;\\n    }\\n    va(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        throw this.Ra.cancel(), new Error(`Invalid bundle format: ${t}`);\\n    }\\n    /**\\n     * Pulls more data from underlying stream to internal buffer.\\n     * Returns a boolean indicating whether the stream is finished.\\n     */    async Ca() {\\n        const t = await this.Ra.read();\\n        if (!t.done) {\\n            const e = new Uint8Array(this.buffer.length + t.value.length);\\n            e.set(this.buffer), e.set(t.value, this.buffer.length), this.buffer = e;\\n        }\\n        return t.done;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Internal transaction object responsible for accumulating the mutations to\\n * perform and the base versions for any documents read.\\n */\\nclass Oa {\\n    constructor(t) {\\n        this.datastore = t, \\n        // The version of each document that was read during this transaction.\\n        this.readVersions = new Map, this.mutations = [], this.committed = !1, \\n        /**\\n         * A deferred usage error that occurred previously in this transaction that\\n         * will cause the transaction to fail once it actually commits.\\n         */\\n        this.lastWriteError = null, \\n        /**\\n         * Set of documents that have been written in the transaction.\\n         *\\n         * When there's more than one write to the same key in a transaction, any\\n         * writes after the first are handled differently.\\n         */\\n        this.writtenDocs = new Set;\\n    }\\n    async lookup(t) {\\n        if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Q(G.INVALID_ARGUMENT, \\\"Firestore transactions require all reads to be executed before all writes.\\\");\\n        const e = await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                documents: e.map((t => ys(n.M, t)))\\n            }, r = await n._o(\\\"BatchGetDocuments\\\", s, i), o = new Map;\\n            r.forEach((t => {\\n                const e = Ps(n.M, t);\\n                o.set(e.key.toString(), e);\\n            }));\\n            const u = [];\\n            return e.forEach((t => {\\n                const e = o.get(t.toString());\\n                U(!!e), u.push(e);\\n            })), u;\\n        }(this.datastore, t);\\n        return e.forEach((t => this.recordVersion(t))), e;\\n    }\\n    set(t, e) {\\n        this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    update(t, e) {\\n        try {\\n            this.write(e.toMutation(t, this.preconditionForUpdate(t)));\\n        } catch (t) {\\n            this.lastWriteError = t;\\n        }\\n        this.writtenDocs.add(t.toString());\\n    }\\n    delete(t) {\\n        this.write(new On(t, this.precondition(t))), this.writtenDocs.add(t.toString());\\n    }\\n    async commit() {\\n        if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;\\n        const t = this.readVersions;\\n        // For each mutation, note that the doc was written.\\n                this.mutations.forEach((e => {\\n            t.delete(e.key.toString());\\n        })), \\n        // For each document that was read but not written to, we want to perform\\n        // a `verify` operation.\\n        t.forEach(((t, e) => {\\n            const n = xt.fromPath(e);\\n            this.mutations.push(new Fn(n, this.precondition(n)));\\n        })), await async function(t, e) {\\n            const n = K(t), s = Es(n.M) + \\\"/documents\\\", i = {\\n                writes: e.map((t => vs(n.M, t)))\\n            };\\n            await n.co(\\\"Commit\\\", s, i);\\n        }(this.datastore, this.mutations), this.committed = !0;\\n    }\\n    recordVersion(t) {\\n        let e;\\n        if (t.isFoundDocument()) e = t.version; else {\\n            if (!t.isNoDocument()) throw L();\\n            // For deleted docs, we must use baseVersion 0 when we overwrite them.\\n            e = ct.min();\\n        }\\n        const n = this.readVersions.get(t.key.toString());\\n        if (n) {\\n            if (!e.isEqual(n)) \\n            // This transaction will fail no matter what.\\n            throw new Q(G.ABORTED, \\\"Document version changed between two reads.\\\");\\n        } else this.readVersions.set(t.key.toString(), e);\\n    }\\n    /**\\n     * Returns the version of this document when it was read in this transaction,\\n     * as a precondition, or no precondition if it was not read.\\n     */    precondition(t) {\\n        const e = this.readVersions.get(t.toString());\\n        return !this.writtenDocs.has(t.toString()) && e ? An.updateTime(e) : An.none();\\n    }\\n    /**\\n     * Returns the precondition for a document if the operation is an update.\\n     */    preconditionForUpdate(t) {\\n        const e = this.readVersions.get(t.toString());\\n        // The first time a document is written, we want to take into account the\\n        // read time and existence\\n                if (!this.writtenDocs.has(t.toString()) && e) {\\n            if (e.isEqual(ct.min())) \\n            // The document doesn't exist, so fail the transaction.\\n            // This has to be validated locally because you can't send a\\n            // precondition that a document does not exist without changing the\\n            // semantics of the backend write to be an insert. This is the reverse\\n            // of what we want, since we want to assert that the document doesn't\\n            // exist but then send the update and have it fail. Since we can't\\n            // express that to the backend, we have to validate locally.\\n            // Note: this can change once we can send separate verify writes in the\\n            // transaction.\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Can't update a document that doesn't exist.\\\");\\n            // Document exists, base precondition on document update time.\\n                        return An.updateTime(e);\\n        }\\n        // Document was not read, so we just use the preconditions for a blind\\n        // update.\\n        return An.exists(!0);\\n    }\\n    write(t) {\\n        this.ensureCommitNotCalled(), this.mutations.push(t);\\n    }\\n    ensureCommitNotCalled() {}\\n}\\n\\n/**\\n * @license\\n * Copyright 2019 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * TransactionRunner encapsulates the logic needed to run and retry transactions\\n * with backoff.\\n */ class Fa {\\n    constructor(t, e, n, s, i) {\\n        this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s, \\n        this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, \\\"transaction_retry\\\" /* TransactionRetry */);\\n    }\\n    /** Runs the transaction and sets the result on deferred. */    run() {\\n        this.xa -= 1, this.Na();\\n    }\\n    Na() {\\n        this.No.Ro((async () => {\\n            const t = new Oa(this.datastore), e = this.ka(t);\\n            e && e.then((e => {\\n                this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {\\n                    this.deferred.resolve(e);\\n                })).catch((t => {\\n                    this.Ma(t);\\n                }))));\\n            })).catch((t => {\\n                this.Ma(t);\\n            }));\\n        }));\\n    }\\n    ka(t) {\\n        try {\\n            const e = this.updateFunction(t);\\n            return !St(e) && e.catch && e.then ? e : (this.deferred.reject(Error(\\\"Transaction callback must return a Promise\\\")), \\n            null);\\n        } catch (t) {\\n            // Do not retry errors thrown by user provided updateFunction.\\n            return this.deferred.reject(t), null;\\n        }\\n    }\\n    Ma(t) {\\n        this.xa > 0 && this.Oa(t) ? (this.xa -= 1, this.asyncQueue.enqueueAndForget((() => (this.Na(), \\n        Promise.resolve())))) : this.deferred.reject(t);\\n    }\\n    Oa(t) {\\n        if (\\\"FirebaseError\\\" === t.name) {\\n            // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\\n            // non-matching document versions with ABORTED. These errors should be retried.\\n            const e = t.code;\\n            return \\\"aborted\\\" === e || \\\"failed-precondition\\\" === e || !Un(e);\\n        }\\n        return !1;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * FirestoreClient is a top-level class that constructs and owns all of the\\n * pieces of the client SDK architecture. It is responsible for creating the\\n * async queue that is shared by all of the other components in the system.\\n */\\nclass $a {\\n    constructor(t, e, \\n    /**\\n     * Asynchronous queue responsible for all of our internal processing. When\\n     * we get incoming work from the user (via public API) or the network\\n     * (incoming GRPC messages), we should always schedule onto this queue.\\n     * This ensures all of our work is properly serialized (e.g. we don't\\n     * start processing a new operation while the previous one is waiting for\\n     * an async I/O to complete).\\n     */\\n    n, s) {\\n        this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s, \\n        this.user = C.UNAUTHENTICATED, this.clientId = it.R(), this.authCredentialListener = () => Promise.resolve(), \\n        this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {\\n            O(\\\"FirestoreClient\\\", \\\"Received user=\\\", t.uid), await this.authCredentialListener(t), \\n            this.user = t;\\n        })), this.appCheckCredentials.start(n, (t => (O(\\\"FirestoreClient\\\", \\\"Received new app check token=\\\", t), \\n        this.appCheckCredentialListener(t, this.user))));\\n    }\\n    async getConfiguration() {\\n        return {\\n            asyncQueue: this.asyncQueue,\\n            databaseInfo: this.databaseInfo,\\n            clientId: this.clientId,\\n            authCredentials: this.authCredentials,\\n            appCheckCredentials: this.appCheckCredentials,\\n            initialUser: this.user,\\n            maxConcurrentLimboResolutions: 100\\n        };\\n    }\\n    setCredentialChangeListener(t) {\\n        this.authCredentialListener = t;\\n    }\\n    setAppCheckTokenChangeListener(t) {\\n        this.appCheckCredentialListener = t;\\n    }\\n    /**\\n     * Checks that the client has not been terminated. Ensures that other methods on\\n     * this class cannot be called after the client is terminated.\\n     */    verifyNotTerminated() {\\n        if (this.asyncQueue.isShuttingDown) throw new Q(G.FAILED_PRECONDITION, \\\"The client has already been terminated.\\\");\\n    }\\n    terminate() {\\n        this.asyncQueue.enterRestrictedMode();\\n        const t = new j;\\n        return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async () => {\\n            try {\\n                this.onlineComponents && await this.onlineComponents.terminate(), this.offlineComponents && await this.offlineComponents.terminate(), \\n                // The credentials provider must be terminated after shutting down the\\n                // RemoteStore as it will prevent the RemoteStore from retrieving auth\\n                // tokens.\\n                this.authCredentials.shutdown(), this.appCheckCredentials.shutdown(), t.resolve();\\n            } catch (e) {\\n                const n = Su(e, \\\"Failed to shutdown persistence\\\");\\n                t.reject(n);\\n            }\\n        })), t.promise;\\n    }\\n}\\n\\nasync function Ba(t, e) {\\n    t.asyncQueue.verifyOperationInProgress(), O(\\\"FirestoreClient\\\", \\\"Initializing OfflineComponentProvider\\\");\\n    const n = await t.getConfiguration();\\n    await e.initialize(n);\\n    let s = n.initialUser;\\n    t.setCredentialChangeListener((async t => {\\n        s.isEqual(t) || (await so(e.localStore, t), s = t);\\n    })), \\n    // When a user calls clearPersistence() in one client, all other clients\\n    // need to be terminated to allow the delete to succeed.\\n    e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;\\n}\\n\\nasync function La(t, e) {\\n    t.asyncQueue.verifyOperationInProgress();\\n    const n = await Ua(t);\\n    O(\\\"FirestoreClient\\\", \\\"Initializing OnlineComponentProvider\\\");\\n    const s = await t.getConfiguration();\\n    await e.initialize(n, s), \\n    // The CredentialChangeListener of the online component provider takes\\n    // precedence over the offline component provider.\\n    t.setCredentialChangeListener((t => Ru(e.remoteStore, t))), t.setAppCheckTokenChangeListener(((t, n) => Ru(e.remoteStore, n))), \\n    t.onlineComponents = e;\\n}\\n\\nasync function Ua(t) {\\n    return t.offlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OfflineComponentProvider\\\"), \\n    await Ba(t, new Sa)), t.offlineComponents;\\n}\\n\\nasync function qa(t) {\\n    return t.onlineComponents || (O(\\\"FirestoreClient\\\", \\\"Using default OnlineComponentProvider\\\"), \\n    await La(t, new xa)), t.onlineComponents;\\n}\\n\\nfunction Ka(t) {\\n    return Ua(t).then((t => t.persistence));\\n}\\n\\nfunction Ga(t) {\\n    return Ua(t).then((t => t.localStore));\\n}\\n\\nfunction Qa(t) {\\n    return qa(t).then((t => t.remoteStore));\\n}\\n\\nfunction ja(t) {\\n    return qa(t).then((t => t.syncEngine));\\n}\\n\\nasync function Wa(t) {\\n    const e = await qa(t), n = e.eventManager;\\n    return n.onListen = Yu.bind(null, e.syncEngine), n.onUnlisten = Zu.bind(null, e.syncEngine), \\n    n;\\n}\\n\\n/** Enables the network connection and re-enqueues all pending operations. */ function za(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!0), function(t) {\\n            const e = K(t);\\n            return e.wu.delete(0 /* UserDisabled */), tu(e);\\n        }(n);\\n    }));\\n}\\n\\n/** Disables the network connection. Pending operations will not complete. */ function Ha(t) {\\n    return t.asyncQueue.enqueue((async () => {\\n        const e = await Ka(t), n = await Qa(t);\\n        return e.setNetworkEnabled(!1), async function(t) {\\n            const e = K(t);\\n            e.wu.add(0 /* UserDisabled */), await eu(e), \\n            // Set the OnlineState to Offline so get()s return from cache, etc.\\n            e.yu.set(\\\"Offline\\\" /* Offline */);\\n        }(n);\\n    }));\\n}\\n\\n/**\\n * Returns a Promise that resolves when all writes that were pending at the time\\n * this method was called received server acknowledgement. An acknowledgement\\n * can be either acceptance or rejection.\\n */ function Ja(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await function(t, e) {\\n                const n = K(t);\\n                return n.persistence.runTransaction(\\\"read document\\\", \\\"readonly\\\", (t => n.fi.Ls(t, e)));\\n            }(t, e);\\n            s.isFoundDocument() ? n.resolve(s) : s.isNoDocument() ? n.resolve(null) : n.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)\\\"));\\n        } catch (t) {\\n            const s = Su(t, `Failed to get document '${e} from cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated document from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Ya(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: r => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o)));\\n                const u = r.docs.has(n);\\n                !u && r.fromCache ? \\n                // TODO(dimond): If we're online and the document doesn't\\n                // exist then we resolve with a doc.exists set to false. If\\n                // we're offline however, we reject the Promise in this\\n                // case. Two options: 1) Cache the negative response from\\n                // the server so we can deliver that even when you're\\n                // offline 2) Actually reject the Promise in the online case\\n                // if the document doesn't exist.\\n                i.reject(new Q(G.UNAVAILABLE, \\\"Failed to get document because the client is offline.\\\")) : u && r.fromCache && s && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached document.)')) : i.resolve(r);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(Ke(n.path), r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction Xa(t, e) {\\n    const n = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {\\n        try {\\n            const s = await lo(t, e, \\n            /* usePreviousResults= */ !0), i = new Wu(e, s._i), r = i.Wu(s.documents), o = i.applyChanges(r, \\n            /* updateLimboDocuments= */ !1);\\n            n.resolve(o.snapshot);\\n        } catch (t) {\\n            const s = Su(t, `Failed to execute query '${e} against cache`);\\n            n.reject(s);\\n        }\\n    }\\n    /**\\n * Retrieves a latency-compensated query snapshot from the backend via a\\n * SnapshotListener.\\n */ (await Ga(t), e, n))), n.promise;\\n}\\n\\nfunction Za(t, e, n = {}) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {\\n        const r = new ka({\\n            next: n => {\\n                // Remove query first before passing event to user to avoid\\n                // user actions affecting the now stale query.\\n                e.enqueueAndForget((() => Ou(t, o))), n.fromCache && \\\"server\\\" === s.source ? i.reject(new Q(G.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \\\"server\\\" to retrieve the cached documents.)')) : i.resolve(n);\\n            },\\n            error: t => i.reject(t)\\n        }), o = new Lu(n, r, {\\n            includeMetadataChanges: !0,\\n            ku: !0\\n        });\\n        return Mu(t, o);\\n    }(await Wa(t), t.asyncQueue, e, n, s))), s.promise;\\n}\\n\\nfunction tc(t, e) {\\n    const n = new ka(e);\\n    return t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n        K(t).bu.add(e), \\n        // Immediately fire an initial event, indicating all existing listeners\\n        // are in-sync.\\n        e.next();\\n    }(await Wa(t), n))), () => {\\n        n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {\\n            K(t).bu.delete(e);\\n        }(await Wa(t), n)));\\n    };\\n}\\n\\n/**\\n * Takes an updateFunction in which a set of reads and writes can be performed\\n * atomically. In the updateFunction, the client can read and write values\\n * using the supplied transaction object. After the updateFunction, all\\n * changes will be committed. If a retryable error occurs (ex: some other\\n * client has changed any of the data referenced), then the updateFunction\\n * will be called again after a backoff. If the updateFunction still fails\\n * after all retries, then the transaction will be rejected.\\n *\\n * The transaction object passed to the updateFunction contains methods for\\n * accessing documents and collections. Unlike other datastore access, data\\n * accessed with the transaction will not reflect local changes that have not\\n * been committed. For this reason, it is required that all reads are\\n * performed before any writes. Transactions must be performed while online.\\n */ function ec(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueueAndForget((async () => {\\n        const i = await function(t) {\\n            return qa(t).then((t => t.datastore));\\n        }(t);\\n        new Fa(t.asyncQueue, i, n, e, s).run();\\n    })), s.promise;\\n}\\n\\nfunction nc(t, e, n, s) {\\n    const i = function(t, e) {\\n        let n;\\n        n = \\\"string\\\" == typeof t ? (new TextEncoder).encode(t) : t;\\n        return function(t, e) {\\n            return new Ma(t, e);\\n        }(function(t, e) {\\n            if (t instanceof Uint8Array) return Na(t, e);\\n            if (t instanceof ArrayBuffer) return Na(new Uint8Array(t), e);\\n            if (t instanceof ReadableStream) return t.getReader();\\n            throw new Error(\\\"Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream\\\");\\n        }(n), e);\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (n, jo(e));\\n    t.asyncQueue.enqueueAndForget((async () => {\\n        va(await ja(t), i, s);\\n    }));\\n}\\n\\nfunction sc(t, e) {\\n    return t.asyncQueue.enqueue((async () => function(t, e) {\\n        const n = K(t);\\n        return n.persistence.runTransaction(\\\"Get named query\\\", \\\"readonly\\\", (t => n._s.getNamedQuery(t, e)));\\n    }(await Ga(t), e)));\\n}\\n\\nconst ic = new Map;\\n\\n/**\\n * An instance map that ensures only one Datastore exists per Firestore\\n * instance.\\n */\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\nfunction rc(t, e, n) {\\n    if (!n) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);\\n}\\n\\n/**\\n * Validates that two boolean options are not set at the same time.\\n * @internal\\n */ function oc(t, e, n, s) {\\n    if (!0 === e && !0 === s) throw new Q(G.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a document (indicated by the fact it contains\\n * an even numbers of segments).\\n */ function uc(t) {\\n    if (!xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Validates that `path` refers to a collection (indicated by the fact it\\n * contains an odd numbers of segments).\\n */ function ac(t) {\\n    if (xt.isDocumentKey(t)) throw new Q(G.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);\\n}\\n\\n/**\\n * Returns true if it's a non-null object without a custom prototype\\n * (i.e. excludes Array, Date, etc.).\\n */\\n/** Returns a string describing the type / value of the provided input. */\\nfunction cc(t) {\\n    if (void 0 === t) return \\\"undefined\\\";\\n    if (null === t) return \\\"null\\\";\\n    if (\\\"string\\\" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`), \\n    JSON.stringify(t);\\n    if (\\\"number\\\" == typeof t || \\\"boolean\\\" == typeof t) return \\\"\\\" + t;\\n    if (\\\"object\\\" == typeof t) {\\n        if (t instanceof Array) return \\\"an array\\\";\\n        {\\n            const e = \\n            /** try to get the constructor name for an object. */\\n            function(t) {\\n                if (t.constructor) return t.constructor.name;\\n                return null;\\n            }\\n            /**\\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\\n * underlying instance. Throws if  `obj` is not an instance of `T`.\\n *\\n * This cast is used in the Lite and Full SDK to verify instance types for\\n * arguments passed to the public API.\\n * @internal\\n */ (t);\\n            return e ? `a custom ${e} object` : \\\"an object\\\";\\n        }\\n    }\\n    return \\\"function\\\" == typeof t ? \\\"a function\\\" : L();\\n}\\n\\nfunction hc(t, \\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\ne) {\\n    if (\\\"_delegate\\\" in t && (\\n    // Unwrap Compat types\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    t = t._delegate), !(t instanceof e)) {\\n        if (e.name === t.constructor.name) throw new Q(G.INVALID_ARGUMENT, \\\"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?\\\");\\n        {\\n            const n = cc(t);\\n            throw new Q(G.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);\\n        }\\n    }\\n    return t;\\n}\\n\\nfunction lc(t, e) {\\n    if (e <= 0) throw new Q(G.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// settings() defaults:\\n/**\\n * A concrete type describing all the values that can be applied via a\\n * user-supplied `FirestoreSettings` object. This is a separate type so that\\n * defaults can be supplied and the value can be checked for equality.\\n */\\nclass fc {\\n    constructor(t) {\\n        var e;\\n        if (void 0 === t.host) {\\n            if (void 0 !== t.ssl) throw new Q(G.INVALID_ARGUMENT, \\\"Can't provide ssl option if host option is not set\\\");\\n            this.host = \\\"firestore.googleapis.com\\\", this.ssl = true;\\n        } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;\\n        if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, \\n        void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {\\n            if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n            this.cacheSizeBytes = t.cacheSizeBytes;\\n        }\\n        this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, \\n        this.useFetchStreams = !!t.useFetchStreams, oc(\\\"experimentalForceLongPolling\\\", t.experimentalForceLongPolling, \\\"experimentalAutoDetectLongPolling\\\", t.experimentalAutoDetectLongPolling);\\n    }\\n    isEqual(t) {\\n        return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */ class dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        this._authCredentials = e, this._appCheckCredentials = n, \\n        /**\\n         * Whether it's a Firestore or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore-lite\\\", this._persistenceKey = \\\"(lite)\\\", this._settings = new fc({}), \\n        this._settingsFrozen = !1, t instanceof vt ? this._databaseId = t : (this._app = t, \\n        this._databaseId = function(t) {\\n            if (!Object.prototype.hasOwnProperty.apply(t.options, [ \\\"projectId\\\" ])) throw new Q(G.INVALID_ARGUMENT, '\\\"projectId\\\" not provided in firebase.initializeApp.');\\n            return new vt(t.options.projectId);\\n        }\\n        /**\\n * Modify this instance to communicate with the Cloud Firestore emulator.\\n *\\n * Note: This must be called before this instance has been used to do any\\n * operations.\\n *\\n * @param firestore - The `Firestore` instance to configure to connect to the\\n * emulator.\\n * @param host - the emulator host (ex: localhost).\\n * @param port - the emulator port (ex: 9000).\\n * @param options.mockUserToken - the mock auth token to use for unit testing\\n * Security Rules.\\n */ (t));\\n    }\\n    /**\\n     * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\\n     * instance.\\n     */    get app() {\\n        if (!this._app) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore was not initialized using the Firebase SDK. 'app' is not available\\\");\\n        return this._app;\\n    }\\n    get _initialized() {\\n        return this._settingsFrozen;\\n    }\\n    get _terminated() {\\n        return void 0 !== this._terminateTask;\\n    }\\n    _setSettings(t) {\\n        if (this._settingsFrozen) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.\\\");\\n        this._settings = new fc(t), void 0 !== t.credentials && (this._authCredentials = function(t) {\\n            if (!t) return new z;\\n            switch (t.type) {\\n              case \\\"gapi\\\":\\n                const e = t.client;\\n                // Make sure this really is a Gapi client.\\n                                return U(!(\\\"object\\\" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), \\n                new X(e, t.sessionIndex || \\\"0\\\", t.iamToken || null);\\n\\n              case \\\"provider\\\":\\n                return t.client;\\n\\n              default:\\n                throw new Q(G.INVALID_ARGUMENT, \\\"makeAuthCredentialsProvider failed due to invalid credential type\\\");\\n            }\\n        }(t.credentials));\\n    }\\n    _getSettings() {\\n        return this._settings;\\n    }\\n    _freezeSettings() {\\n        return this._settingsFrozen = !0, this._settings;\\n    }\\n    _delete() {\\n        return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask;\\n    }\\n    /** Returns a JSON-serializable representation of this `Firestore` instance. */    toJSON() {\\n        return {\\n            app: this._app,\\n            databaseId: this._databaseId,\\n            settings: this._settings\\n        };\\n    }\\n    /**\\n     * Terminates all components used by this client. Subclasses can override\\n     * this method to clean up their own dependencies, but must also call this\\n     * method.\\n     *\\n     * Only ever called once.\\n     */    _terminate() {\\n        /**\\n * Removes all components associated with the provided instance. Must be called\\n * when the `Firestore` instance is terminated.\\n */\\n        return function(t) {\\n            const e = ic.get(t);\\n            e && (O(\\\"ComponentProvider\\\", \\\"Removing Datastore\\\"), ic.delete(t), e.terminate());\\n        }(this), Promise.resolve();\\n    }\\n}\\n\\nfunction _c(t, e, n, s = {}) {\\n    var i;\\n    const r = (t = hc(t, dc))._getSettings();\\n    if (\\\"firestore.googleapis.com\\\" !== r.host && r.host !== e && $(\\\"Host has been set in both settings() and useEmulator(), emulator host will be used\\\"), \\n    t._setSettings(Object.assign(Object.assign({}, r), {\\n        host: `${e}:${n}`,\\n        ssl: !1\\n    })), s.mockUserToken) {\\n        let e, n;\\n        if (\\\"string\\\" == typeof s.mockUserToken) e = s.mockUserToken, n = C.MOCK_USER; else {\\n            // Let createMockUserToken validate first (catches common mistakes like\\n            // invalid field \\\"uid\\\" and missing field \\\"sub\\\" / \\\"user_id\\\".)\\n            e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.createMockUserToken)(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);\\n            const r = s.mockUserToken.sub || s.mockUserToken.user_id;\\n            if (!r) throw new Q(G.INVALID_ARGUMENT, \\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\n            n = new C(r);\\n        }\\n        t._authCredentials = new H(new W(e, n));\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentReference` refers to a document location in a Firestore database\\n * and can be used to write, read, or listen to the location. The document at\\n * the referenced location may or may not exist.\\n */ class wc {\\n    /** @hideconstructor */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._key = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"document\\\", this.firestore = t;\\n    }\\n    get _path() {\\n        return this._key.path;\\n    }\\n    /**\\n     * The document's identifier within its collection.\\n     */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced document (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._key.path.canonicalString();\\n    }\\n    /**\\n     * The collection this `DocumentReference` belongs to.\\n     */    get parent() {\\n        return new gc(this.firestore, this.converter, this._key.path.popLast());\\n    }\\n    withConverter(t) {\\n        return new wc(this.firestore, t, this._key);\\n    }\\n}\\n\\n/**\\n * A `Query` refers to a query which you can read or listen to. You can also\\n * construct refined `Query` objects by adding filters and ordering.\\n */ class mc {\\n    // This is the lite version of the Query class in the main SDK.\\n    /** @hideconstructor protected */\\n    constructor(t, \\n    /**\\n     * If provided, the `FirestoreDataConverter` associated with this instance.\\n     */\\n    e, n) {\\n        this.converter = e, this._query = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"query\\\", this.firestore = t;\\n    }\\n    withConverter(t) {\\n        return new mc(this.firestore, t, this._query);\\n    }\\n}\\n\\n/**\\n * A `CollectionReference` object can be used for adding documents, getting\\n * document references, and querying for documents (using {@link query}).\\n */ class gc extends mc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, Ke(n)), this._path = n, \\n        /** The type of this Firestore reference. */\\n        this.type = \\\"collection\\\";\\n    }\\n    /** The collection's identifier. */    get id() {\\n        return this._query.path.lastSegment();\\n    }\\n    /**\\n     * A string representing the path of the referenced collection (relative\\n     * to the root of the database).\\n     */    get path() {\\n        return this._query.path.canonicalString();\\n    }\\n    /**\\n     * A reference to the containing `DocumentReference` if this is a\\n     * subcollection. If this isn't a subcollection, the reference is null.\\n     */    get parent() {\\n        const t = this._path.popLast();\\n        return t.isEmpty() ? null : new wc(this.firestore, \\n        /* converter= */ null, new xt(t));\\n    }\\n    withConverter(t) {\\n        return new gc(this.firestore, t, this._path);\\n    }\\n}\\n\\nfunction yc(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), rc(\\\"collection\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return ac(s), new gc(t, /* converter= */ null, s);\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return ac(s), new gc(t.firestore, \\n        /* converter= */ null, s);\\n    }\\n}\\n\\n// TODO(firestorelite): Consider using ErrorFactory -\\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\\n/**\\n * Creates and returns a new `Query` instance that includes all documents in the\\n * database that are contained in a collection or subcollection with the\\n * given `collectionId`.\\n *\\n * @param firestore - A reference to the root `Firestore` instance.\\n * @param collectionId - Identifies the collections to query over. Every\\n * collection or subcollection with this ID as the last segment of its path\\n * will be included. Cannot contain a slash.\\n * @returns The created `Query`.\\n */ function pc(t, e) {\\n    if (t = hc(t, dc), rc(\\\"collectionGroup\\\", \\\"collection id\\\", e), e.indexOf(\\\"/\\\") >= 0) throw new Q(G.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);\\n    return new mc(t, \\n    /* converter= */ null, \\n    /**\\n * Creates a new Query for a collection group query that matches all documents\\n * within the provided collection group.\\n */\\n    function(t) {\\n        return new Ue(_t.emptyPath(), t);\\n    }(e));\\n}\\n\\nfunction Ic(t, e, ...n) {\\n    if (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), \\n    // We allow omission of 'pathString' but explicitly prohibit passing in both\\n    // 'undefined' and 'null'.\\n    1 === arguments.length && (e = it.R()), rc(\\\"doc\\\", \\\"path\\\", e), t instanceof dc) {\\n        const s = _t.fromString(e, ...n);\\n        return uc(s), new wc(t, \\n        /* converter= */ null, new xt(s));\\n    }\\n    {\\n        if (!(t instanceof wc || t instanceof gc)) throw new Q(G.INVALID_ARGUMENT, \\\"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore\\\");\\n        const s = t._path.child(_t.fromString(e, ...n));\\n        return uc(s), new wc(t.firestore, t instanceof gc ? t.converter : null, new xt(s));\\n    }\\n}\\n\\n/**\\n * Returns true if the provided references are equal.\\n *\\n * @param left - A reference to compare.\\n * @param right - A reference to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Tc(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), (t instanceof wc || t instanceof gc) && (e instanceof wc || e instanceof gc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);\\n}\\n\\n/**\\n * Returns true if the provided queries point to the same collection and apply\\n * the same constraints.\\n *\\n * @param left - A `Query` to compare.\\n * @param right - A `Query` to compare.\\n * @returns true if the references point to the same location in the same\\n * Firestore database.\\n */ function Ec(t, e) {\\n    return t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t), e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e), t instanceof mc && e instanceof mc && (t.firestore === e.firestore && Ye(t._query, e._query) && t.converter === e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ class Ac {\\n    constructor() {\\n        // The last promise in the queue.\\n        this.Fa = Promise.resolve(), \\n        // A list of retryable operations. Retryable operations are run in order and\\n        // retried with backoff.\\n        this.$a = [], \\n        // Is this AsyncQueue being shut down? Once it is set to true, it will not\\n        // be changed again.\\n        this.Ba = !1, \\n        // Operations scheduled to be queued in the future. Operations are\\n        // automatically removed after they are run or canceled.\\n        this.La = [], \\n        // visible for testing\\n        this.Ua = null, \\n        // Flag set while there's an outstanding AsyncQueue operation, used for\\n        // assertion sanity-checks.\\n        this.qa = !1, \\n        // Enabled during shutdown on Safari to prevent future access to IndexedDB.\\n        this.Ka = !1, \\n        // List of TimerIds to fast-forward delays for.\\n        this.Ga = [], \\n        // Backoff timer used to schedule retries for retryable operations\\n        this.No = new Wo(this, \\\"async_queue_retry\\\" /* AsyncQueueRetry */), \\n        // Visibility handler that triggers an immediate retry of all retryable\\n        // operations. Meant to speed up recovery when we regain file system access\\n        // after page comes into foreground.\\n        this.Qa = () => {\\n            const t = Qo();\\n            t && O(\\\"AsyncQueue\\\", \\\"Visibility state changed to \\\" + t.visibilityState), this.No.Po();\\n        };\\n        const t = Qo();\\n        t && \\\"function\\\" == typeof t.addEventListener && t.addEventListener(\\\"visibilitychange\\\", this.Qa);\\n    }\\n    get isShuttingDown() {\\n        return this.Ba;\\n    }\\n    /**\\n     * Adds a new operation to the queue without waiting for it to complete (i.e.\\n     * we ignore the Promise result).\\n     */    enqueueAndForget(t) {\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.enqueue(t);\\n    }\\n    enqueueAndForgetEvenWhileRestricted(t) {\\n        this.ja(), \\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\n        this.Wa(t);\\n    }\\n    enterRestrictedMode(t) {\\n        if (!this.Ba) {\\n            this.Ba = !0, this.Ka = t || !1;\\n            const e = Qo();\\n            e && \\\"function\\\" == typeof e.removeEventListener && e.removeEventListener(\\\"visibilitychange\\\", this.Qa);\\n        }\\n    }\\n    enqueue(t) {\\n        if (this.ja(), this.Ba) \\n        // Return a Promise which never resolves.\\n        return new Promise((() => {}));\\n        // Create a deferred Promise that we can return to the callee. This\\n        // allows us to return a \\\"hanging Promise\\\" only to the callee and still\\n        // advance the queue even when the operation is not run.\\n                const e = new j;\\n        return this.Wa((() => this.Ba && this.Ka ? Promise.resolve() : (t().then(e.resolve, e.reject), \\n        e.promise))).then((() => e.promise));\\n    }\\n    enqueueRetryable(t) {\\n        this.enqueueAndForget((() => (this.$a.push(t), this.za())));\\n    }\\n    /**\\n     * Runs the next operation from the retryable queue. If the operation fails,\\n     * reschedules with backoff.\\n     */    async za() {\\n        if (0 !== this.$a.length) {\\n            try {\\n                await this.$a[0](), this.$a.shift(), this.No.reset();\\n            } catch (t) {\\n                if (!Ai(t)) throw t;\\n // Failure will be handled by AsyncQueue\\n                                O(\\\"AsyncQueue\\\", \\\"Operation failed with retryable error: \\\" + t);\\n            }\\n            this.$a.length > 0 && \\n            // If there are additional operations, we re-schedule `retryNextOp()`.\\n            // This is necessary to run retryable operations that failed during\\n            // their initial attempt since we don't know whether they are already\\n            // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\\n            // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\\n            // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\\n            // call scheduled here.\\n            // Since `backoffAndRun()` cancels an existing backoff and schedules a\\n            // new backoff on every call, there is only ever a single additional\\n            // operation in the queue.\\n            this.No.Ro((() => this.za()));\\n        }\\n    }\\n    Wa(t) {\\n        const e = this.Fa.then((() => (this.qa = !0, t().catch((t => {\\n            this.Ua = t, this.qa = !1;\\n            const e = \\n            /**\\n * Chrome includes Error.message in Error.stack. Other browsers do not.\\n * This returns expected output of message + stack when available.\\n * @param error - Error or FirestoreError\\n */\\n            function(t) {\\n                let e = t.message || \\\"\\\";\\n                t.stack && (e = t.stack.includes(t.message) ? t.stack : t.message + \\\"\\\\n\\\" + t.stack);\\n                return e;\\n            }\\n            /**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ (t);\\n            // Re-throw the error so that this.tail becomes a rejected Promise and\\n            // all further attempts to chain (via .then) will just short-circuit\\n            // and return the rejected Promise.\\n            throw F(\\\"INTERNAL UNHANDLED ERROR: \\\", e), t;\\n        })).then((t => (this.qa = !1, t))))));\\n        return this.Fa = e, e;\\n    }\\n    enqueueAfterDelay(t, e, n) {\\n        this.ja(), \\n        // Fast-forward delays for timerIds that have been overriden.\\n        this.Ga.indexOf(t) > -1 && (e = 0);\\n        const s = vu.createAndSchedule(this, t, e, n, (t => this.Ha(t)));\\n        return this.La.push(s), s;\\n    }\\n    ja() {\\n        this.Ua && L();\\n    }\\n    verifyOperationInProgress() {}\\n    /**\\n     * Waits until all currently queued tasks are finished executing. Delayed\\n     * operations are not run.\\n     */    async Ja() {\\n        // Operations in the queue prior to draining may have enqueued additional\\n        // operations. Keep draining the queue until the tail is no longer advanced,\\n        // which indicates that no more new operations were enqueued and that all\\n        // operations were executed.\\n        let t;\\n        do {\\n            t = this.Fa, await t;\\n        } while (t !== this.Fa);\\n    }\\n    /**\\n     * For Tests: Determine if a delayed operation with a particular TimerId\\n     * exists.\\n     */    Ya(t) {\\n        for (const e of this.La) if (e.timerId === t) return !0;\\n        return !1;\\n    }\\n    /**\\n     * For Tests: Runs some or all delayed operations early.\\n     *\\n     * @param lastTimerId - Delayed operations up to and including this TimerId\\n     * will be drained. Pass TimerId.All to run all delayed operations.\\n     * @returns a Promise that resolves once all operations have been run.\\n     */    Xa(t) {\\n        // Note that draining may generate more delayed ops, so we do that first.\\n        return this.Ja().then((() => {\\n            // Run ops in the same order they'd run if they ran naturally.\\n            this.La.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));\\n            for (const e of this.La) if (e.skipDelay(), \\\"all\\\" /* All */ !== t && e.timerId === t) break;\\n            return this.Ja();\\n        }));\\n    }\\n    /**\\n     * For Tests: Skip all subsequent delays for a timer id.\\n     */    Za(t) {\\n        this.Ga.push(t);\\n    }\\n    /** Called once a DelayedOperation is run or canceled. */    Ha(t) {\\n        // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\\n        const e = this.La.indexOf(t);\\n        this.La.splice(e, 1);\\n    }\\n}\\n\\nfunction Rc(t) {\\n    /**\\n * Returns true if obj is an object and contains at least one of the specified\\n * methods.\\n */\\n    return function(t, e) {\\n        if (\\\"object\\\" != typeof t || null === t) return !1;\\n        const n = t;\\n        for (const t of e) if (t in n && \\\"function\\\" == typeof n[t]) return !0;\\n        return !1;\\n    }\\n    /**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n    /**\\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\\n * loading, as well as task completion and error events.\\n *\\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\\n */ (t, [ \\\"next\\\", \\\"error\\\", \\\"complete\\\" ]);\\n}\\n\\nclass bc {\\n    constructor() {\\n        this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {\\n            taskState: \\\"Running\\\",\\n            totalBytes: 0,\\n            totalDocuments: 0,\\n            bytesLoaded: 0,\\n            documentsLoaded: 0\\n        };\\n    }\\n    /**\\n     * Registers functions to listen to bundle loading progress events.\\n     * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\\n     *   each time a Firestore document is loaded from the bundle.\\n     * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\\n     *   error, and there should be no more updates after this.\\n     * @param complete - Called when the loading task is complete.\\n     */    onProgress(t, e, n) {\\n        this._progressObserver = {\\n            next: t,\\n            error: e,\\n            complete: n\\n        };\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\\n     *\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    catch(t) {\\n        return this._taskCompletionResolver.promise.catch(t);\\n    }\\n    /**\\n     * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\\n     *\\n     * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\\n     *   The update will always have its `taskState` set to `\\\"Success\\\"`.\\n     * @param onRejected - Called when an error occurs during bundle loading.\\n     */    then(t, e) {\\n        return this._taskCompletionResolver.promise.then(t, e);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has completed, with a provided\\n     * `LoadBundleTaskProgress` object.\\n     *\\n     * @private\\n     */    _completeWith(t) {\\n        this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), \\n        this._taskCompletionResolver.resolve(t);\\n    }\\n    /**\\n     * Notifies all observers that bundle loading has failed, with a provided\\n     * `Error` as the reason.\\n     *\\n     * @private\\n     */    _failWith(t) {\\n        this._lastProgress.taskState = \\\"Error\\\", this._progressObserver.next && this._progressObserver.next(this._lastProgress), \\n        this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t);\\n    }\\n    /**\\n     * Notifies a progress update of loading a bundle.\\n     * @param progress - The new progress.\\n     *\\n     * @private\\n     */    _updateProgress(t) {\\n        this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/** DOMException error code constants. */ const Pc = -1;\\n\\n/**\\n * The Cloud Firestore service interface.\\n *\\n * Do not call this constructor directly. Instead, use {@link getFirestore}.\\n */\\nclass Vc extends dc {\\n    /** @hideconstructor */\\n    constructor(t, e, n) {\\n        super(t, e, n), \\n        /**\\n         * Whether it's a {@link Firestore} or Firestore Lite instance.\\n         */\\n        this.type = \\\"firestore\\\", this._queue = new Ac, this._persistenceKey = \\\"name\\\" in t ? t.name : \\\"[DEFAULT]\\\";\\n    }\\n    _terminate() {\\n        return this._firestoreClient || \\n        // The client must be initialized to ensure that all subsequent API\\n        // usage throws an exception.\\n        Cc(this), this._firestoreClient.terminate();\\n    }\\n}\\n\\n/**\\n * Initializes a new instance of {@link Firestore} with the provided settings.\\n * Can only be called before any other function, including\\n * {@link getFirestore}. If the custom settings are empty, this function is\\n * equivalent to calling {@link getFirestore}.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\\n * be associated.\\n * @param settings - A settings object to configure the {@link Firestore} instance.\\n * @returns A newly initialized {@link Firestore} instance.\\n */ function vc(t, e) {\\n    const n = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(t, \\\"firestore\\\");\\n    if (n.isInitialized()) {\\n        const t = n.getImmediate(), s = n.getOptions();\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.deepEqual)(s, e)) return t;\\n        throw new Q(G.FAILED_PRECONDITION, \\\"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.\\\");\\n    }\\n    if (void 0 !== e.cacheSizeBytes && -1 !== e.cacheSizeBytes && e.cacheSizeBytes < 1048576) throw new Q(G.INVALID_ARGUMENT, \\\"cacheSizeBytes must be at least 1048576\\\");\\n    return n.initialize({\\n        options: e\\n    });\\n}\\n\\n/**\\n * Returns the existing {@link Firestore} instance that is associated with the\\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\\n * instance with default settings.\\n *\\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\\n * instance is associated with.\\n * @returns The {@link Firestore} instance of the provided app.\\n */ function Sc(e = (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp)()) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider)(e, \\\"firestore\\\").getImmediate();\\n}\\n\\n/**\\n * @internal\\n */ function Dc(t) {\\n    return t._firestoreClient || Cc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;\\n}\\n\\nfunction Cc(t) {\\n    var e;\\n    const n = t._freezeSettings(), s = function(t, e, n, s) {\\n        return new Vt(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);\\n    }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || \\\"\\\", t._persistenceKey, n);\\n    t._firestoreClient = new $a(t._authCredentials, t._appCheckCredentials, t._queue, s);\\n}\\n\\n/**\\n * Attempts to enable persistent storage, if possible.\\n *\\n * Must be called before any other functions (other than\\n * {@link initializeFirestore}, {@link getFirestore} or\\n * {@link clearIndexedDbPersistence}.\\n *\\n * If this fails, `enableIndexedDbPersistence()` will reject the promise it\\n * returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @param persistenceSettings - Optional settings object to configure\\n * persistence.\\n * @returns A `Promise` that represents successfully enabling persistent storage.\\n */ function xc(t, e) {\\n    qc(t = hc(t, Vc));\\n    const n = Dc(t), s = t._freezeSettings(), i = new xa;\\n    return kc(n, i, new Da(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));\\n}\\n\\n/**\\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\\n * across all tabs, all operations share access to local persistence, including\\n * shared execution of queries and latency-compensated local document updates\\n * across all connected instances.\\n *\\n * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise\\n * it returns. Note that even after this failure, the {@link Firestore} instance will\\n * remain usable, however offline persistence will be disabled.\\n *\\n * There are several reasons why this can fail, which can be identified by\\n * the `code` on the error.\\n *\\n *   * failed-precondition: The app is already open in another browser tab and\\n *     multi-tab is not enabled.\\n *   * unimplemented: The browser is incompatible with the offline\\n *     persistence implementation.\\n *\\n * @param firestore - The {@link Firestore} instance to enable persistence for.\\n * @returns A `Promise` that represents successfully enabling persistent\\n * storage.\\n */ function Nc(t) {\\n    qc(t = hc(t, Vc));\\n    const e = Dc(t), n = t._freezeSettings(), s = new xa;\\n    return kc(e, s, new Ca(s, n.cacheSizeBytes));\\n}\\n\\n/**\\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\\n * If the operation fails with a recoverable error (see\\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\\n * but the client remains usable.\\n */ function kc(t, e, n) {\\n    const s = new j;\\n    return t.asyncQueue.enqueue((async () => {\\n        try {\\n            await Ba(t, n), await La(t, e), s.resolve();\\n        } catch (t) {\\n            if (!\\n            /**\\n * Decides whether the provided error allows us to gracefully disable\\n * persistence (as opposed to crashing the client).\\n */\\n            function(t) {\\n                if (\\\"FirebaseError\\\" === t.name) return t.code === G.FAILED_PRECONDITION || t.code === G.UNIMPLEMENTED;\\n                if (\\\"undefined\\\" != typeof DOMException && t instanceof DOMException) \\n                // There are a few known circumstances where we can open IndexedDb but\\n                // trying to read/write will fail (e.g. quota exceeded). For\\n                // well-understood cases, we attempt to detect these and then gracefully\\n                // fall back to memory persistence.\\n                // NOTE: Rather than continue to add to this list, we could decide to\\n                // always fall back, with the risk that we might accidentally hide errors\\n                // representing actual SDK bugs.\\n                // When the browser is out of quota we could get either quota exceeded\\n                // or an aborted error depending on whether the error happened during\\n                // schema migration.\\n                return 22 === t.code || 20 === t.code || \\n                // Firefox Private Browsing mode disables IndexedDb and returns\\n                // INVALID_STATE for any usage.\\n                11 === t.code;\\n                return !0;\\n            }\\n            /**\\n * Clears the persistent storage. This includes pending writes and cached\\n * documents.\\n *\\n * Must be called while the {@link Firestore} instance is not started (after the app is\\n * terminated or when the app is first initialized). On startup, this function\\n * must be called before other functions (other than {@link\\n * initializeFirestore} or {@link getFirestore})). If the {@link Firestore}\\n * instance is still running, the promise will be rejected with the error code\\n * of `failed-precondition`.\\n *\\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\\n * dropping existing data but does not attempt to securely overwrite or\\n * otherwise make cached data unrecoverable. For applications that are sensitive\\n * to the disclosure of cached data in between user sessions, we strongly\\n * recommend not enabling persistence at all.\\n *\\n * @param firestore - The {@link Firestore} instance to clear persistence for.\\n * @returns A `Promise` that is resolved when the persistent storage is\\n * cleared. Otherwise, the promise is rejected with an error.\\n */ (t)) throw t;\\n            console.warn(\\\"Error enabling offline persistence. Falling back to persistence disabled: \\\" + t), \\n            s.reject(t);\\n        }\\n    })).then((() => s.promise));\\n}\\n\\nfunction Mc(t) {\\n    if (t._initialized && !t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.\\\");\\n    const e = new j;\\n    return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {\\n        try {\\n            await async function(t) {\\n                if (!Ii.vt()) return Promise.resolve();\\n                const e = t + \\\"main\\\";\\n                await Ii.delete(e);\\n            }(Yr(t._databaseId, t._persistenceKey)), e.resolve();\\n        } catch (t) {\\n            e.reject(t);\\n        }\\n    })), e.promise;\\n}\\n\\n/**\\n * Waits until all currently pending writes for the active user have been\\n * acknowledged by the backend.\\n *\\n * The returned promise resolves immediately if there are no outstanding writes.\\n * Otherwise, the promise waits for all previously issued writes (including\\n * those written in a previous app session), but it does not wait for writes\\n * that were added after the function is called. If you want to wait for\\n * additional writes, call `waitForPendingWrites()` again.\\n *\\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\\n * changes.\\n *\\n * @returns A `Promise` which resolves when all currently pending writes have been\\n * acknowledged by the backend.\\n */ function Oc(t) {\\n    return function(t) {\\n        const e = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => oa(await ja(t), e))), e.promise;\\n    }(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Re-enables use of the network for this {@link Firestore} instance after a prior\\n * call to {@link disableNetwork}.\\n *\\n * @returns A `Promise` that is resolved once the network has been enabled.\\n */ function Fc(t) {\\n    return za(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Disables network usage for this instance. It can be re-enabled via {@link\\n * enableNetwork}. While the network is disabled, any snapshot listeners,\\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\\n * operations will be queued until the network is restored.\\n *\\n * @returns A `Promise` that is resolved once the network has been disabled.\\n */ function $c(t) {\\n    return Ha(Dc(t = hc(t, Vc)));\\n}\\n\\n/**\\n * Terminates the provided {@link Firestore} instance.\\n *\\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\\n * may be used. Any other function will throw a `FirestoreError`.\\n *\\n * To restart after termination, create a new instance of FirebaseFirestore with\\n * {@link getFirestore}.\\n *\\n * Termination does not cancel any pending writes, and any promises that are\\n * awaiting a response from the server will not be resolved. If you have\\n * persistence enabled, the next time you start this instance, it will resume\\n * sending these writes to the server.\\n *\\n * Note: Under normal circumstances, calling `terminate()` is not required. This\\n * function is useful only when you want to force this instance to release all\\n * of its resources or in combination with `clearIndexedDbPersistence()` to\\n * ensure that all local state is destroyed between test runs.\\n *\\n * @returns A `Promise` that is resolved when the instance has been successfully\\n * terminated.\\n */ function Bc(t) {\\n    return (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance)(t.app, \\\"firestore\\\"), t._delete();\\n}\\n\\n/**\\n * Loads a Firestore bundle into the local cache.\\n *\\n * @param firestore - The {@link Firestore} instance to load bundles for.\\n * @param bundleData - An object representing the bundle to be loaded. Valid\\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\\n *\\n * @returns A `LoadBundleTask` object, which notifies callers with progress\\n * updates, and completion or error events. It can be used as a\\n * `Promise<LoadBundleTaskProgress>`.\\n */ function Lc(t, e) {\\n    const n = Dc(t = hc(t, Vc)), s = new bc;\\n    return nc(n, t._databaseId, e, s), s;\\n}\\n\\n/**\\n * Reads a Firestore {@link Query} from local cache, identified by the given\\n * name.\\n *\\n * The named queries are packaged  into bundles on the server side (along\\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\\n * in local cache, use this method to extract a {@link Query} by name.\\n *\\n * @param firestore - The {@link Firestore} instance to read the query from.\\n * @param name - The name of the query.\\n * @returns A `Promise` that is resolved with the Query or `null`.\\n */ function Uc(t, e) {\\n    return sc(Dc(t = hc(t, Vc)), e).then((e => e ? new mc(t, null, e.query) : null));\\n}\\n\\nfunction qc(t) {\\n    if (t._initialized || t._terminated) throw new Q(G.FAILED_PRECONDITION, \\\"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `FieldPath` refers to a field in a document. The path may consist of a\\n * single field name (referring to a top-level field in the document), or a\\n * list of field names (referring to a nested field in the document).\\n *\\n * Create a `FieldPath` by providing field names. If more than one field\\n * name is provided, the path will point to a nested field in a document.\\n */\\nclass Kc {\\n    /**\\n     * Creates a `FieldPath` from the provided field names. If more than one field\\n     * name is provided, the path will point to a nested field in a document.\\n     *\\n     * @param fieldNames - A list of field names.\\n     */\\n    constructor(...t) {\\n        for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid field name at argument $(i + 1). Field names must not be empty.\\\");\\n        this._internalPath = new mt(t);\\n    }\\n    /**\\n     * Returns true if this `FieldPath` is equal to the provided one.\\n     *\\n     * @param other - The `FieldPath` to compare against.\\n     * @returns true if this `FieldPath` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._internalPath.isEqual(t._internalPath);\\n    }\\n}\\n\\n/**\\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\\n * It can be used in queries to sort or filter by the document ID.\\n */ function Gc() {\\n    return new Kc(\\\"__name__\\\");\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing an array of bytes.\\n */ class Qc {\\n    /** @hideconstructor */\\n    constructor(t) {\\n        this._byteString = t;\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Base64 string, converting it to\\n     * bytes.\\n     *\\n     * @param base64 - The Base64 string used to create the `Bytes` object.\\n     */    static fromBase64String(t) {\\n        try {\\n            return new Qc(pt.fromBase64String(t));\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to construct data from Base64 string: \\\" + t);\\n        }\\n    }\\n    /**\\n     * Creates a new `Bytes` object from the given Uint8Array.\\n     *\\n     * @param array - The Uint8Array used to create the `Bytes` object.\\n     */    static fromUint8Array(t) {\\n        return new Qc(pt.fromUint8Array(t));\\n    }\\n    /**\\n     * Returns the underlying bytes as a Base64-encoded string.\\n     *\\n     * @returns The Base64-encoded string created from the `Bytes` object.\\n     */    toBase64() {\\n        return this._byteString.toBase64();\\n    }\\n    /**\\n     * Returns the underlying bytes in a new `Uint8Array`.\\n     *\\n     * @returns The Uint8Array created from the `Bytes` object.\\n     */    toUint8Array() {\\n        return this._byteString.toUint8Array();\\n    }\\n    /**\\n     * Returns a string representation of the `Bytes` object.\\n     *\\n     * @returns A string representation of the `Bytes` object.\\n     */    toString() {\\n        return \\\"Bytes(base64: \\\" + this.toBase64() + \\\")\\\";\\n    }\\n    /**\\n     * Returns true if this `Bytes` object is equal to the provided one.\\n     *\\n     * @param other - The `Bytes` object to compare against.\\n     * @returns true if this `Bytes` object is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._byteString.isEqual(t._byteString);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Sentinel values that can be used when writing document fields with `set()`\\n * or `update()`.\\n */ class jc {\\n    /**\\n     * @param _methodName - The public API endpoint that returns this class.\\n     * @hideconstructor\\n     */\\n    constructor(t) {\\n        this._methodName = t;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * An immutable object representing a geographic location in Firestore. The\\n * location is represented as latitude/longitude pair.\\n *\\n * Latitude values are in the range of [-90, 90].\\n * Longitude values are in the range of [-180, 180].\\n */ class Wc {\\n    /**\\n     * Creates a new immutable `GeoPoint` object with the provided latitude and\\n     * longitude values.\\n     * @param latitude - The latitude as number between -90 and 90.\\n     * @param longitude - The longitude as number between -180 and 180.\\n     */\\n    constructor(t, e) {\\n        if (!isFinite(t) || t < -90 || t > 90) throw new Q(G.INVALID_ARGUMENT, \\\"Latitude must be a number between -90 and 90, but was: \\\" + t);\\n        if (!isFinite(e) || e < -180 || e > 180) throw new Q(G.INVALID_ARGUMENT, \\\"Longitude must be a number between -180 and 180, but was: \\\" + e);\\n        this._lat = t, this._long = e;\\n    }\\n    /**\\n     * The latitude of this `GeoPoint` instance.\\n     */    get latitude() {\\n        return this._lat;\\n    }\\n    /**\\n     * The longitude of this `GeoPoint` instance.\\n     */    get longitude() {\\n        return this._long;\\n    }\\n    /**\\n     * Returns true if this `GeoPoint` is equal to the provided one.\\n     *\\n     * @param other - The `GeoPoint` to compare against.\\n     * @returns true if this `GeoPoint` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this._lat === t._lat && this._long === t._long;\\n    }\\n    /** Returns a JSON-serializable representation of this GeoPoint. */    toJSON() {\\n        return {\\n            latitude: this._lat,\\n            longitude: this._long\\n        };\\n    }\\n    /**\\n     * Actually private to JS consumers of our API, so this function is prefixed\\n     * with an underscore.\\n     */    _compareTo(t) {\\n        return rt(this._lat, t._lat) || rt(this._long, t._long);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2017 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const zc = /^__.*__$/;\\n\\n/** The result of parsing document data (e.g. for a setData call). */ class Hc {\\n    constructor(t, e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return null !== this.fieldMask ? new xn(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Cn(t, this.data, e, this.fieldTransforms);\\n    }\\n}\\n\\n/** The result of parsing \\\"update\\\" data (i.e. for an updateData call). */ class Jc {\\n    constructor(t, \\n    // The fieldMask does not include document transforms.\\n    e, n) {\\n        this.data = t, this.fieldMask = e, this.fieldTransforms = n;\\n    }\\n    toMutation(t, e) {\\n        return new xn(t, this.data, this.fieldMask, e, this.fieldTransforms);\\n    }\\n}\\n\\nfunction Yc(t) {\\n    switch (t) {\\n      case 0 /* Set */ :\\n // fall through\\n              case 2 /* MergeSet */ :\\n // fall through\\n              case 1 /* Update */ :\\n        return !0;\\n\\n      case 3 /* Argument */ :\\n      case 4 /* ArrayArgument */ :\\n        return !1;\\n\\n      default:\\n        throw L();\\n    }\\n}\\n\\n/** A \\\"context\\\" object passed around while parsing user data. */ class Xc {\\n    /**\\n     * Initializes a ParseContext with the given source and path.\\n     *\\n     * @param settings - The settings for the parser.\\n     * @param databaseId - The database ID of the Firestore instance.\\n     * @param serializer - The serializer to use to generate the Value proto.\\n     * @param ignoreUndefinedProperties - Whether to ignore undefined properties\\n     * rather than throw.\\n     * @param fieldTransforms - A mutable list of field transforms encountered\\n     * while parsing the data.\\n     * @param fieldMask - A mutable list of field paths encountered while parsing\\n     * the data.\\n     *\\n     * TODO(b/34871131): We don't support array paths right now, so path can be\\n     * null to indicate the context represents any location within an array (in\\n     * which case certain features will not work and errors will be somewhat\\n     * compromised).\\n     */\\n    constructor(t, e, n, s, i, r) {\\n        this.settings = t, this.databaseId = e, this.M = n, this.ignoreUndefinedProperties = s, \\n        // Minor hack: If fieldTransforms is undefined, we assume this is an\\n        // external call and we need to validate the entire path.\\n        void 0 === i && this.tc(), this.fieldTransforms = i || [], this.fieldMask = r || [];\\n    }\\n    get path() {\\n        return this.settings.path;\\n    }\\n    get ec() {\\n        return this.settings.ec;\\n    }\\n    /** Returns a new context with the specified settings overwritten. */    nc(t) {\\n        return new Xc(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.M, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);\\n    }\\n    sc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.rc(t), s;\\n    }\\n    oc(t) {\\n        var e;\\n        const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.nc({\\n            path: n,\\n            ic: !1\\n        });\\n        return s.tc(), s;\\n    }\\n    uc(t) {\\n        // TODO(b/34871131): We don't support array paths right now; so make path\\n        // undefined.\\n        return this.nc({\\n            path: void 0,\\n            ic: !0\\n        });\\n    }\\n    ac(t) {\\n        return yh(t, this.settings.methodName, this.settings.cc || !1, this.path, this.settings.hc);\\n    }\\n    /** Returns 'true' if 'fieldPath' was traversed when creating this context. */    contains(t) {\\n        return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));\\n    }\\n    tc() {\\n        // TODO(b/34871131): Remove null check once we have proper paths for fields\\n        // within arrays.\\n        if (this.path) for (let t = 0; t < this.path.length; t++) this.rc(this.path.get(t));\\n    }\\n    rc(t) {\\n        if (0 === t.length) throw this.ac(\\\"Document fields must not be empty\\\");\\n        if (Yc(this.ec) && zc.test(t)) throw this.ac('Document fields cannot begin and end with \\\"__\\\"');\\n    }\\n}\\n\\n/**\\n * Helper for parsing raw user input (provided via the API) into internal model\\n * classes.\\n */ class Zc {\\n    constructor(t, e, n) {\\n        this.databaseId = t, this.ignoreUndefinedProperties = e, this.M = n || jo(t);\\n    }\\n    /** Creates a new top-level parse context. */    lc(t, e, n, s = !1) {\\n        return new Xc({\\n            ec: t,\\n            methodName: e,\\n            hc: n,\\n            path: mt.emptyPath(),\\n            ic: !1,\\n            cc: s\\n        }, this.databaseId, this.M, this.ignoreUndefinedProperties);\\n    }\\n}\\n\\nfunction th(t) {\\n    const e = t._freezeSettings(), n = jo(t._databaseId);\\n    return new Zc(t._databaseId, !!e.ignoreUndefinedProperties, n);\\n}\\n\\n/** Parse document data from a set() call. */ function eh(t, e, n, s, i, r = {}) {\\n    const o = t.lc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);\\n    _h(\\\"Data must be an object, but it was:\\\", o, s);\\n    const u = fh(s, o);\\n    let a, c;\\n    if (r.merge) a = new gt(o.fieldMask), c = o.fieldTransforms; else if (r.mergeFields) {\\n        const t = [];\\n        for (const s of r.mergeFields) {\\n            const i = wh(e, s, n);\\n            if (!o.contains(i)) throw new Q(G.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);\\n            ph(t, i) || t.push(i);\\n        }\\n        a = new gt(t), c = o.fieldTransforms.filter((t => a.covers(t.field)));\\n    } else a = null, c = o.fieldTransforms;\\n    return new Hc(new te(u), a, c);\\n}\\n\\nclass nh extends jc {\\n    _toFieldTransform(t) {\\n        if (2 /* MergeSet */ !== t.ec) throw 1 /* Update */ === t.ec ? t.ac(`${this._methodName}() can only appear at the top level of your update data`) : t.ac(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);\\n        // No transform to add for a delete, but we need to add it to our\\n        // fieldMask so it gets deleted.\\n        return t.fieldMask.push(t.path), null;\\n    }\\n    isEqual(t) {\\n        return t instanceof nh;\\n    }\\n}\\n\\n/**\\n * Creates a child context for parsing SerializableFieldValues.\\n *\\n * This is different than calling `ParseContext.contextWith` because it keeps\\n * the fieldTransforms and fieldMask separate.\\n *\\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\\n * Although these values are used with writes, any elements in these FieldValues\\n * are not considered writes since they cannot contain any FieldValue sentinels,\\n * etc.\\n *\\n * @param fieldValue - The sentinel FieldValue for which to create a child\\n *     context.\\n * @param context - The parent context.\\n * @param arrayElement - Whether or not the FieldValue has an array.\\n */ function sh(t, e, n) {\\n    return new Xc({\\n        ec: 3 /* Argument */ ,\\n        hc: e.settings.hc,\\n        methodName: t._methodName,\\n        ic: n\\n    }, e.databaseId, e.M, e.ignoreUndefinedProperties);\\n}\\n\\nclass ih extends jc {\\n    _toFieldTransform(t) {\\n        return new In(t.path, new fn);\\n    }\\n    isEqual(t) {\\n        return t instanceof ih;\\n    }\\n}\\n\\nclass rh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new dn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass oh extends jc {\\n    constructor(t, e) {\\n        super(t), this.fc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = sh(this, t, \\n        /*array=*/ !0), n = this.fc.map((t => lh(t, e))), s = new wn(n);\\n        return new In(t.path, s);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\nclass uh extends jc {\\n    constructor(t, e) {\\n        super(t), this.dc = e;\\n    }\\n    _toFieldTransform(t) {\\n        const e = new gn(t.M, un(t.M, this.dc));\\n        return new In(t.path, e);\\n    }\\n    isEqual(t) {\\n        // TODO(mrschmidt): Implement isEquals\\n        return this === t;\\n    }\\n}\\n\\n/** Parse update data from an update() call. */ function ah(t, e, n, s) {\\n    const i = t.lc(1 /* Update */ , e, n);\\n    _h(\\\"Data must be an object, but it was:\\\", i, s);\\n    const r = [], o = te.empty();\\n    lt(s, ((t, s) => {\\n        const u = gh(e, t, n);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                s = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(s);\\n        const a = i.oc(u);\\n        if (s instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        r.push(u); else {\\n            const t = lh(s, a);\\n            null != t && (r.push(u), o.set(u, t));\\n        }\\n    }));\\n    const u = new gt(r);\\n    return new Jc(o, u, i.fieldTransforms);\\n}\\n\\n/** Parse update data from a list of field/value arguments. */ function ch(t, e, n, s, i, r) {\\n    const o = t.lc(1 /* Update */ , e, n), u = [ wh(e, s, n) ], a = [ i ];\\n    if (r.length % 2 != 0) throw new Q(G.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);\\n    for (let t = 0; t < r.length; t += 2) u.push(wh(e, r[t])), a.push(r[t + 1]);\\n    const c = [], h = te.empty();\\n    // We iterate in reverse order to pick the last value for a field if the\\n    // user specified the field multiple times.\\n    for (let t = u.length - 1; t >= 0; --t) if (!ph(c, u[t])) {\\n        const e = u[t];\\n        let n = a[t];\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n);\\n        const s = o.oc(e);\\n        if (n instanceof nh) \\n        // Add it to the field mask, but don't add anything to updateData.\\n        c.push(e); else {\\n            const t = lh(n, s);\\n            null != t && (c.push(e), h.set(e, t));\\n        }\\n    }\\n    const l = new gt(c);\\n    return new Jc(h, l, o.fieldTransforms);\\n}\\n\\n/**\\n * Parse a \\\"query value\\\" (e.g. value in a where filter or a value in a cursor\\n * bound).\\n *\\n * @param allowArrays - Whether the query value is an array that may directly\\n * contain additional arrays (e.g. the operand of an `in` query).\\n */ function hh(t, e, n, s = !1) {\\n    return lh(n, t.lc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));\\n}\\n\\n/**\\n * Parses user data to Protobuf Values.\\n *\\n * @param input - Data to be parsed.\\n * @param context - A context object representing the current path being parsed,\\n * the source of the data being parsed, etc.\\n * @returns The parsed value, or null if the value was a FieldValue sentinel\\n * that should not be included in the resulting parsed data.\\n */ function lh(t, e) {\\n    if (dh(\\n    // Unwrap the API type from the Compat SDK. This will return the API type\\n    // from firestore-exp.\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return _h(\\\"Unsupported field value:\\\", e, t), fh(t, e);\\n    if (t instanceof jc) \\n    // FieldValues usually parse into transforms (except deleteField())\\n    // in which case we do not want to include this field in our parsed data\\n    // (as doing so will overwrite the field directly prior to the transform\\n    // trying to transform it). So we don't add this location to\\n    // context.fieldMask and we return null as our parsing result.\\n    /**\\n * \\\"Parses\\\" the provided FieldValueImpl, adding any necessary transforms to\\n * context.fieldTransforms.\\n */\\n    return function(t, e) {\\n        // Sentinels are only supported with writes, and not within arrays.\\n        if (!Yc(e.ec)) throw e.ac(`${t._methodName}() can only be used with update() and set()`);\\n        if (!e.path) throw e.ac(`${t._methodName}() is not currently supported inside arrays`);\\n        const n = t._toFieldTransform(e);\\n        n && e.fieldTransforms.push(n);\\n    }\\n    /**\\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\\n *\\n * @returns The parsed value\\n */ (t, e), null;\\n    if (void 0 === t && e.ignoreUndefinedProperties) \\n    // If the input is undefined it can never participate in the fieldMask, so\\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\\n    // `parseScalarValue` will reject an undefined value.\\n    return null;\\n    if (\\n    // If context.path is null we are inside an array and we don't support\\n    // field mask paths more granular than the top-level array.\\n    e.path && e.fieldMask.push(e.path), t instanceof Array) {\\n        // TODO(b/34871131): Include the path containing the array in the error\\n        // message.\\n        // In the case of IN queries, the parsed data is an array (representing\\n        // the set of values to be included for the IN query) that may directly\\n        // contain additional arrays (each representing an individual field\\n        // value), so we disable this validation.\\n        if (e.settings.ic && 4 /* ArrayArgument */ !== e.ec) throw e.ac(\\\"Nested arrays are not supported\\\");\\n        return function(t, e) {\\n            const n = [];\\n            let s = 0;\\n            for (const i of t) {\\n                let t = lh(i, e.uc(s));\\n                null == t && (\\n                // Just include nulls in the array for fields being replaced with a\\n                // sentinel.\\n                t = {\\n                    nullValue: \\\"NULL_VALUE\\\"\\n                }), n.push(t), s++;\\n            }\\n            return {\\n                arrayValue: {\\n                    values: n\\n                }\\n            };\\n        }(t, e);\\n    }\\n    return function(t, e) {\\n        if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t))) return {\\n            nullValue: \\\"NULL_VALUE\\\"\\n        };\\n        if (\\\"number\\\" == typeof t) return un(e.M, t);\\n        if (\\\"boolean\\\" == typeof t) return {\\n            booleanValue: t\\n        };\\n        if (\\\"string\\\" == typeof t) return {\\n            stringValue: t\\n        };\\n        if (t instanceof Date) {\\n            const n = at.fromDate(t);\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof at) {\\n            // Firestore backend truncates precision down to microseconds. To ensure\\n            // offline mode works the same with regards to truncation, perform the\\n            // truncation immediately without waiting for the backend to do that.\\n            const n = new at(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\\n            return {\\n                timestampValue: fs(e.M, n)\\n            };\\n        }\\n        if (t instanceof Wc) return {\\n            geoPointValue: {\\n                latitude: t.latitude,\\n                longitude: t.longitude\\n            }\\n        };\\n        if (t instanceof Qc) return {\\n            bytesValue: ds(e.M, t._byteString)\\n        };\\n        if (t instanceof wc) {\\n            const n = e.databaseId, s = t.firestore._databaseId;\\n            if (!s.isEqual(n)) throw e.ac(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);\\n            return {\\n                referenceValue: ms(t.firestore._databaseId || e.databaseId, t._key.path)\\n            };\\n        }\\n        throw e.ac(`Unsupported field value: ${cc(t)}`);\\n    }\\n    /**\\n * Checks whether an object looks like a JSON object that should be converted\\n * into a struct. Normal class/prototype instances are considered to look like\\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\\n * GeoPoints, etc. are not considered to look like JSON objects since they map\\n * to specific FieldValue types other than ObjectValue.\\n */ (t, e);\\n}\\n\\nfunction fh(t, e) {\\n    const n = {};\\n    return ft(t) ? \\n    // If we encounter an empty object, we explicitly add it to the update\\n    // mask to ensure that the server creates a map entry.\\n    e.path && e.path.length > 0 && e.fieldMask.push(e.path) : lt(t, ((t, s) => {\\n        const i = lh(s, e.sc(t));\\n        null != i && (n[t] = i);\\n    })), {\\n        mapValue: {\\n            fields: n\\n        }\\n    };\\n}\\n\\nfunction dh(t) {\\n    return !(\\\"object\\\" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof at || t instanceof Wc || t instanceof Qc || t instanceof wc || t instanceof jc);\\n}\\n\\nfunction _h(t, e, n) {\\n    if (!dh(n) || !function(t) {\\n        return \\\"object\\\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\\n    }(n)) {\\n        const s = cc(n);\\n        throw \\\"an object\\\" === s ? e.ac(t + \\\" a custom object\\\") : e.ac(t + \\\" \\\" + s);\\n    }\\n}\\n\\n/**\\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\\n */ function wh(t, e, n) {\\n    if ((\\n    // If required, replace the FieldPath Compat class with with the firestore-exp\\n    // FieldPath.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) instanceof Kc) return e._internalPath;\\n    if (\\\"string\\\" == typeof e) return gh(t, e);\\n    throw yh(\\\"Field path arguments must be of type string or \\\", t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n}\\n\\n/**\\n * Matches any characters in a field path string that are reserved.\\n */ const mh = new RegExp(\\\"[~\\\\\\\\*/\\\\\\\\[\\\\\\\\]]\\\");\\n\\n/**\\n * Wraps fromDotSeparatedString with an error message about the method that\\n * was thrown.\\n * @param methodName - The publicly visible method name\\n * @param path - The dot-separated string form of a field path which will be\\n * split on dots.\\n * @param targetDoc - The document against which the field path will be\\n * evaluated.\\n */ function gh(t, e, n) {\\n    if (e.search(mh) >= 0) throw yh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t, \\n    /* hasConverter= */ !1, \\n    /* path= */ void 0, n);\\n    try {\\n        return new Kc(...e.split(\\\".\\\"))._internalPath;\\n    } catch (s) {\\n        throw yh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t, \\n        /* hasConverter= */ !1, \\n        /* path= */ void 0, n);\\n    }\\n}\\n\\nfunction yh(t, e, n, s, i) {\\n    const r = s && !s.isEmpty(), o = void 0 !== i;\\n    let u = `Function ${e}() called with invalid data`;\\n    n && (u += \\\" (via `toFirestore()`)\\\"), u += \\\". \\\";\\n    let a = \\\"\\\";\\n    return (r || o) && (a += \\\" (found\\\", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`), \\n    a += \\\")\\\"), new Q(G.INVALID_ARGUMENT, u + t + a);\\n}\\n\\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function ph(t, e) {\\n    return t.some((t => t.isEqual(e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Ih {\\n    // Note: This class is stripped down version of the DocumentSnapshot in\\n    // the legacy SDK. The changes are:\\n    // - No support for SnapshotMetadata.\\n    // - No support for SnapshotOptions.\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i) {\\n        this._firestore = t, this._userDataWriter = e, this._key = n, this._document = s, \\n        this._converter = i;\\n    }\\n    /** Property of the `DocumentSnapshot` that provides the document's ID. */    get id() {\\n        return this._key.path.lastSegment();\\n    }\\n    /**\\n     * The `DocumentReference` for the document included in the `DocumentSnapshot`.\\n     */    get ref() {\\n        return new wc(this._firestore, this._converter, this._key);\\n    }\\n    /**\\n     * Signals whether or not the document at the snapshot's location exists.\\n     *\\n     * @returns true if the document exists.\\n     */    exists() {\\n        return null !== this._document;\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * @returns An `Object` containing all fields in the document or `undefined`\\n     * if the document doesn't exist.\\n     */    data() {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const t = new Th(this._firestore, this._userDataWriter, this._key, this._document, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t) {\\n        if (this._document) {\\n            const e = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== e) return this._userDataWriter.convertValue(e);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class Th extends Ih {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * @override\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data() {\\n        return super.data();\\n    }\\n}\\n\\n/**\\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\\n */ function Eh(t, e) {\\n    return \\\"string\\\" == typeof e ? gh(t, e) : e instanceof Kc ? e._internalPath : e._delegate._internalPath;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Metadata about a snapshot, describing the state of the snapshot.\\n */ class Ah {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this.hasPendingWrites = t, this.fromCache = e;\\n    }\\n    /**\\n     * Returns true if this `SnapshotMetadata` is equal to the provided one.\\n     *\\n     * @param other - The `SnapshotMetadata` to compare against.\\n     * @returns true if this `SnapshotMetadata` is equal to the provided one.\\n     */    isEqual(t) {\\n        return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;\\n    }\\n}\\n\\n/**\\n * A `DocumentSnapshot` contains data read from a document in your Firestore\\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\\n * get a specific field.\\n *\\n * For a `DocumentSnapshot` that points to a non-existing document, any data\\n * access will return 'undefined'. You can use the `exists()` method to\\n * explicitly verify a document's existence.\\n */ class Rh extends Ih {\\n    /** @hideconstructor protected */\\n    constructor(t, e, n, s, i, r) {\\n        super(t, e, n, s, r), this._firestore = t, this._firestoreImpl = t, this.metadata = i;\\n    }\\n    /**\\n     * Returns whether or not the data exists. True if the document exists.\\n     */    exists() {\\n        return super.exists();\\n    }\\n    /**\\n     * Retrieves all fields in the document as an `Object`. Returns `undefined` if\\n     * the document doesn't exist.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document or `undefined` if\\n     * the document doesn't exist.\\n     */    data(t = {}) {\\n        if (this._document) {\\n            if (this._converter) {\\n                // We only want to use the converter and create a new DocumentSnapshot\\n                // if a converter has been provided.\\n                const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, \\n                /* converter= */ null);\\n                return this._converter.fromFirestore(e, t);\\n            }\\n            return this._userDataWriter.convertValue(this._document.data.value, t.serverTimestamps);\\n        }\\n    }\\n    /**\\n     * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\\n     * document or field doesn't exist.\\n     *\\n     * By default, a `serverTimestamp()` that has not yet been set to\\n     * its final value will be returned as `null`. You can override this by\\n     * passing an options object.\\n     *\\n     * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\\n     * field.\\n     * @param options - An options object to configure how the field is retrieved\\n     * from the snapshot (for example the desired behavior for server timestamps\\n     * that have not yet been set to their final value).\\n     * @returns The data at the specified field location or undefined if no such\\n     * field exists in the document.\\n     */\\n    // We are using `any` here to avoid an explicit cast by our users.\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    get(t, e = {}) {\\n        if (this._document) {\\n            const n = this._document.data.field(Eh(\\\"DocumentSnapshot.get\\\", t));\\n            if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);\\n        }\\n    }\\n}\\n\\n/**\\n * A `QueryDocumentSnapshot` contains data read from a document in your\\n * Firestore database as part of a query. The document is guaranteed to exist\\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\\n * specific field.\\n *\\n * A `QueryDocumentSnapshot` offers the same API surface as a\\n * `DocumentSnapshot`. Since query results contain only existing documents, the\\n * `exists` property will always be true and `data()` will never return\\n * 'undefined'.\\n */ class bh extends Rh {\\n    /**\\n     * Retrieves all fields in the document as an `Object`.\\n     *\\n     * By default, `serverTimestamp()` values that have not yet been\\n     * set to their final value will be returned as `null`. You can override\\n     * this by passing an options object.\\n     *\\n     * @override\\n     * @param options - An options object to configure how data is retrieved from\\n     * the snapshot (for example the desired behavior for server timestamps that\\n     * have not yet been set to their final value).\\n     * @returns An `Object` containing all fields in the document.\\n     */\\n    data(t = {}) {\\n        return super.data(t);\\n    }\\n}\\n\\n/**\\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\\n * representing the results of a query. The documents can be accessed as an\\n * array via the `docs` property or enumerated using the `forEach` method. The\\n * number of documents can be determined via the `empty` and `size`\\n * properties.\\n */ class Ph {\\n    /** @hideconstructor */\\n    constructor(t, e, n, s) {\\n        this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache), \\n        this.query = n;\\n    }\\n    /** An array of all the documents in the `QuerySnapshot`. */    get docs() {\\n        const t = [];\\n        return this.forEach((e => t.push(e))), t;\\n    }\\n    /** The number of documents in the `QuerySnapshot`. */    get size() {\\n        return this._snapshot.docs.size;\\n    }\\n    /** True if there are no documents in the `QuerySnapshot`. */    get empty() {\\n        return 0 === this.size;\\n    }\\n    /**\\n     * Enumerates all of the documents in the `QuerySnapshot`.\\n     *\\n     * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\\n     * each document in the snapshot.\\n     * @param thisArg - The `this` binding for the callback.\\n     */    forEach(t, e) {\\n        this._snapshot.docs.forEach((n => {\\n            t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));\\n        }));\\n    }\\n    /**\\n     * Returns an array of the documents changes since the last snapshot. If this\\n     * is the first snapshot, all documents will be in the list as 'added'\\n     * changes.\\n     *\\n     * @param options - `SnapshotListenOptions` that control whether metadata-only\\n     * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\\n     * snapshot events.\\n     */    docChanges(t = {}) {\\n        const e = !!t.includeMetadataChanges;\\n        if (e && this._snapshot.excludesMetadataChanges) throw new Q(G.INVALID_ARGUMENT, \\\"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().\\\");\\n        return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === e || (this._cachedChanges = \\n        /** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\\n        function(t, e) {\\n            if (t._snapshot.oldDocs.isEmpty()) {\\n                let e = 0;\\n                return t._snapshot.docChanges.map((n => ({\\n                    type: \\\"added\\\",\\n                    doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),\\n                    oldIndex: -1,\\n                    newIndex: e++\\n                })));\\n            }\\n            {\\n                // A `DocumentSet` that is updated incrementally as changes are applied to use\\n                // to lookup the index of a document.\\n                let n = t._snapshot.oldDocs;\\n                return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {\\n                    const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);\\n                    let i = -1, r = -1;\\n                    return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)), \\n                    1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {\\n                        type: Vh(e.type),\\n                        doc: s,\\n                        oldIndex: i,\\n                        newIndex: r\\n                    };\\n                }));\\n            }\\n        }(this, e), this._cachedChangesIncludeMetadataChanges = e), this._cachedChanges;\\n    }\\n}\\n\\nfunction Vh(t) {\\n    switch (t) {\\n      case 0 /* Added */ :\\n        return \\\"added\\\";\\n\\n      case 2 /* Modified */ :\\n      case 3 /* Metadata */ :\\n        return \\\"modified\\\";\\n\\n      case 1 /* Removed */ :\\n        return \\\"removed\\\";\\n\\n      default:\\n        return L();\\n    }\\n}\\n\\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\\n// metadata\\n/**\\n * Returns true if the provided snapshots are equal.\\n *\\n * @param left - A snapshot to compare.\\n * @param right - A snapshot to compare.\\n * @returns true if the snapshots are equal.\\n */ function vh(t, e) {\\n    return t instanceof Rh && e instanceof Rh ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Sh(t) {\\n    if (\\\"L\\\" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new Q(G.UNIMPLEMENTED, \\\"limitToLast() queries require specifying at least one orderBy() clause\\\");\\n}\\n\\n/**\\n * A `QueryConstraint` is used to narrow the set of documents returned by a\\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\\n * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and\\n * can then be passed to {@link query} to create a new query instance that\\n * also contains this `QueryConstraint`.\\n */ class Dh {}\\n\\n/**\\n * Creates a new immutable instance of {@link Query} that is extended to also include\\n * additional query constraints.\\n *\\n * @param query - The {@link Query} instance to use as a base for the new constraints.\\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\\n * @throws if any of the provided query constraints cannot be combined with the\\n * existing or new constraints.\\n */ function Ch(t, ...e) {\\n    for (const n of e) t = n._apply(t);\\n    return t;\\n}\\n\\nclass xh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this._c = t, this.wc = e, this.mc = n, this.type = \\\"where\\\";\\n    }\\n    _apply(t) {\\n        const e = th(t.firestore), n = function(t, e, n, s, i, r, o) {\\n            let u;\\n            if (i.isKeyField()) {\\n                if (\\\"array-contains\\\" /* ARRAY_CONTAINS */ === r || \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ === r) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on documentId().`);\\n                if (\\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r) {\\n                    Wh(o, r);\\n                    const e = [];\\n                    for (const n of o) e.push(jh(s, t, n));\\n                    u = {\\n                        arrayValue: {\\n                            values: e\\n                        }\\n                    };\\n                } else u = jh(s, t, o);\\n            } else \\\"in\\\" /* IN */ !== r && \\\"not-in\\\" /* NOT_IN */ !== r && \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ !== r || Wh(o, r), \\n            u = hh(n, e, o, \\n            /* allowArrays= */ \\\"in\\\" /* IN */ === r || \\\"not-in\\\" /* NOT_IN */ === r);\\n            const a = Ve.create(i, r, u);\\n            return function(t, e) {\\n                if (e.S()) {\\n                    const n = je(t);\\n                    if (null !== n && !n.isEqual(e.field)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);\\n                    const s = Qe(t);\\n                    null !== s && zh(t, e.field, s);\\n                }\\n                const n = function(t, e) {\\n                    for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;\\n                    return null;\\n                }(t, \\n                /**\\n * Given an operator, returns the set of operators that cannot be used with it.\\n *\\n * Operators in a query must adhere to the following set of rules:\\n * 1. Only one array operator is allowed.\\n * 2. Only one disjunctive operator is allowed.\\n * 3. `NOT_EQUAL` cannot be used with another `NOT_EQUAL` operator.\\n * 4. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\\n *\\n * Array operators: `ARRAY_CONTAINS`, `ARRAY_CONTAINS_ANY`\\n * Disjunctive operators: `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`\\n */\\n                function(t) {\\n                    switch (t) {\\n                      case \\\"!=\\\" /* NOT_EQUAL */ :\\n                        return [ \\\"!=\\\" /* NOT_EQUAL */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains\\\" /* ARRAY_CONTAINS */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"in\\\" /* IN */ :\\n                        return [ \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ ];\\n\\n                      case \\\"not-in\\\" /* NOT_IN */ :\\n                        return [ \\\"array-contains\\\" /* ARRAY_CONTAINS */ , \\\"array-contains-any\\\" /* ARRAY_CONTAINS_ANY */ , \\\"in\\\" /* IN */ , \\\"not-in\\\" /* NOT_IN */ , \\\"!=\\\" /* NOT_EQUAL */ ];\\n\\n                      default:\\n                        return [];\\n                    }\\n                }(e.op));\\n                if (null !== n) \\n                // Special case when it's a duplicate op to give a slightly clearer error message.\\n                throw n === e.op ? new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new Q(G.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);\\n            }(t, a), a;\\n        }(t._query, \\\"where\\\", e, t.firestore._databaseId, this._c, this.wc, this.mc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            const n = t.filters.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, n));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that enforces that documents must contain the\\n * specified field and that the value should satisfy the relation constraint\\n * provided.\\n *\\n * @param fieldPath - The path to compare\\n * @param opStr - The operation string (e.g \\\"&lt;\\\", \\\"&lt;=\\\", \\\"==\\\", \\\"&lt;\\\",\\n *   \\\"&lt;=\\\", \\\"!=\\\").\\n * @param value - The value for comparison\\n * @returns The created {@link Query}.\\n */ function Nh(t, e, n) {\\n    const s = e, i = Eh(\\\"where\\\", t);\\n    return new xh(i, s, n);\\n}\\n\\nclass kh extends Dh {\\n    constructor(t, e) {\\n        super(), this._c = t, this.gc = e, this.type = \\\"orderBy\\\";\\n    }\\n    _apply(t) {\\n        const e = function(t, e, n) {\\n            if (null !== t.startAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call startAt() or startAfter() before calling orderBy().\\\");\\n            if (null !== t.endAt) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. You must not call endAt() or endBefore() before calling orderBy().\\\");\\n            const s = new Fe(e, n);\\n            return function(t, e) {\\n                if (null === Qe(t)) {\\n                    // This is the first order by. It must match any inequality.\\n                    const n = je(t);\\n                    null !== n && zh(t, n, e.field);\\n                }\\n            }(t, s), s;\\n        }\\n        /**\\n * Create a `Bound` from a query and a document.\\n *\\n * Note that the `Bound` will always include the key of the document\\n * and so only the provided document will compare equal to the returned\\n * position.\\n *\\n * Will throw if the document does not contain all fields of the order by\\n * of the query or if any of the fields in the order by are an uncommitted\\n * server timestamp.\\n */ (t._query, this._c, this.gc);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            // TODO(dimond): validate that orderBy does not list the same key twice.\\n            const n = t.explicitOrderBy.concat([ e ]);\\n            return new Ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that sorts the query result by the\\n * specified field, optionally in descending order instead of ascending.\\n *\\n * @param fieldPath - The field to sort by.\\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\\n * not specified, order will be ascending.\\n * @returns The created {@link Query}.\\n */ function Mh(t, e = \\\"asc\\\") {\\n    const n = e, s = Eh(\\\"orderBy\\\", t);\\n    return new kh(s, n);\\n}\\n\\nclass Oh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.yc = e, this.Ic = n;\\n    }\\n    _apply(t) {\\n        return new mc(t.firestore, t.converter, Je(t._query, this.yc, this.Ic));\\n    }\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the first matching documents.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function Fh(t) {\\n    return lc(\\\"limit\\\", t), new Oh(\\\"limit\\\", t, \\\"F\\\" /* First */);\\n}\\n\\n/**\\n * Creates a {@link QueryConstraint} that only returns the last matching documents.\\n *\\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\\n * otherwise an exception will be thrown during execution.\\n *\\n * @param limit - The maximum number of items to return.\\n * @returns The created {@link Query}.\\n */ function $h(t) {\\n    return lc(\\\"limitToLast\\\", t), new Oh(\\\"limitToLast\\\", t, \\\"L\\\" /* Last */);\\n}\\n\\nclass Bh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Lh(...t) {\\n    return new Bh(\\\"startAt\\\", t, \\n    /*inclusive=*/ !0);\\n}\\n\\nfunction Uh(...t) {\\n    return new Bh(\\\"startAfter\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nclass qh extends Dh {\\n    constructor(t, e, n) {\\n        super(), this.type = t, this.Tc = e, this.Ec = n;\\n    }\\n    _apply(t) {\\n        const e = Qh(t, this.type, this.Tc, this.Ec);\\n        return new mc(t.firestore, t.converter, function(t, e) {\\n            return new Ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);\\n        }(t._query, e));\\n    }\\n}\\n\\nfunction Kh(...t) {\\n    return new qh(\\\"endBefore\\\", t, \\n    /*inclusive=*/ !1);\\n}\\n\\nfunction Gh(...t) {\\n    return new qh(\\\"endAt\\\", t, /*inclusive=*/ !0);\\n}\\n\\n/** Helper function to create a bound from a document or fields */ function Qh(t, e, n, s) {\\n    if (n[0] = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n[0]), n[0] instanceof Ih) return function(t, e, n, s, i) {\\n        if (!s) throw new Q(G.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);\\n        const r = [];\\n        // Because people expect to continue/end a query at the exact document\\n        // provided, we need to use the implicit sort order rather than the explicit\\n        // sort order, because it's guaranteed to contain the document key. That way\\n        // the position becomes unambiguous and the query continues/ends exactly at\\n        // the provided document. Without the key (by using the explicit sort\\n        // orders), multiple documents could match the position, yielding duplicate\\n        // results.\\n                for (const n of ze(t)) if (n.field.isKeyField()) r.push(qt(e, s.key)); else {\\n            const t = s.data.field(n.field);\\n            if (Rt(t)) throw new Q(G.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field \\\"' + n.field + '\\\" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');\\n            if (null === t) {\\n                const t = n.field.canonicalString();\\n                throw new Q(G.INVALID_ARGUMENT, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);\\n            }\\n            r.push(t);\\n        }\\n        return new Oe(r, i);\\n    }\\n    /**\\n * Converts a list of field values to a `Bound` for the given query.\\n */ (t._query, t.firestore._databaseId, e, n[0]._document, s);\\n    {\\n        const i = th(t.firestore);\\n        return function(t, e, n, s, i, r) {\\n            // Use explicit order by's because it has to match the query the user made\\n            const o = t.explicitOrderBy;\\n            if (i.length > o.length) throw new Q(G.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);\\n            const u = [];\\n            for (let r = 0; r < i.length; r++) {\\n                const a = i[r];\\n                if (o[r].field.isKeyField()) {\\n                    if (\\\"string\\\" != typeof a) throw new Q(G.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);\\n                    if (!We(t) && -1 !== a.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);\\n                    const n = t.path.child(_t.fromString(a));\\n                    if (!xt.isDocumentKey(n)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);\\n                    const i = new xt(n);\\n                    u.push(qt(e, i));\\n                } else {\\n                    const t = hh(n, s, a);\\n                    u.push(t);\\n                }\\n            }\\n            return new Oe(u, r);\\n        }\\n        /**\\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\\n * appropriate errors if the value is anything other than a `DocumentReference`\\n * or `string`, or if the string is malformed.\\n */ (t._query, t.firestore._databaseId, i, e, n, s);\\n    }\\n}\\n\\nfunction jh(t, e, n) {\\n    if (\\\"string\\\" == typeof (n = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(n))) {\\n        if (\\\"\\\" === n) throw new Q(G.INVALID_ARGUMENT, \\\"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.\\\");\\n        if (!We(e) && -1 !== n.indexOf(\\\"/\\\")) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);\\n        const s = e.path.child(_t.fromString(n));\\n        if (!xt.isDocumentKey(s)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);\\n        return qt(t, new xt(s));\\n    }\\n    if (n instanceof wc) return qt(t, n._key);\\n    throw new Q(G.INVALID_ARGUMENT, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${cc(n)}.`);\\n}\\n\\n/**\\n * Validates that the value passed into a disjunctive filter satisfies all\\n * array requirements.\\n */ function Wh(t, e) {\\n    if (!Array.isArray(t) || 0 === t.length) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);\\n    if (t.length > 10) throw new Q(G.INVALID_ARGUMENT, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);\\n}\\n\\nfunction zh(t, e, n) {\\n    if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);\\n}\\n\\n/**\\n * @license\\n * Copyright 2022 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ const Hh = {\\n    maxAttempts: 5\\n};\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts Firestore's internal types to the JavaScript types that we expose\\n * to the user.\\n *\\n * @internal\\n */\\nclass Jh {\\n    convertValue(t, e = \\\"none\\\") {\\n        switch (Mt(t)) {\\n          case 0 /* NullValue */ :\\n            return null;\\n\\n          case 1 /* BooleanValue */ :\\n            return t.booleanValue;\\n\\n          case 2 /* NumberValue */ :\\n            return Et(t.integerValue || t.doubleValue);\\n\\n          case 3 /* TimestampValue */ :\\n            return this.convertTimestamp(t.timestampValue);\\n\\n          case 4 /* ServerTimestampValue */ :\\n            return this.convertServerTimestamp(t, e);\\n\\n          case 5 /* StringValue */ :\\n            return t.stringValue;\\n\\n          case 6 /* BlobValue */ :\\n            return this.convertBytes(At(t.bytesValue));\\n\\n          case 7 /* RefValue */ :\\n            return this.convertReference(t.referenceValue);\\n\\n          case 8 /* GeoPointValue */ :\\n            return this.convertGeoPoint(t.geoPointValue);\\n\\n          case 9 /* ArrayValue */ :\\n            return this.convertArray(t.arrayValue, e);\\n\\n          case 10 /* ObjectValue */ :\\n            return this.convertObject(t.mapValue, e);\\n\\n          default:\\n            throw L();\\n        }\\n    }\\n    convertObject(t, e) {\\n        const n = {};\\n        return lt(t.fields, ((t, s) => {\\n            n[t] = this.convertValue(s, e);\\n        })), n;\\n    }\\n    convertGeoPoint(t) {\\n        return new Wc(Et(t.latitude), Et(t.longitude));\\n    }\\n    convertArray(t, e) {\\n        return (t.values || []).map((t => this.convertValue(t, e)));\\n    }\\n    convertServerTimestamp(t, e) {\\n        switch (e) {\\n          case \\\"previous\\\":\\n            const n = bt(t);\\n            return null == n ? null : this.convertValue(n, e);\\n\\n          case \\\"estimate\\\":\\n            return this.convertTimestamp(Pt(t));\\n\\n          default:\\n            return null;\\n        }\\n    }\\n    convertTimestamp(t) {\\n        const e = Tt(t);\\n        return new at(e.seconds, e.nanos);\\n    }\\n    convertDocumentKey(t, e) {\\n        const n = _t.fromString(t);\\n        U(Ks(n));\\n        const s = new vt(n.get(1), n.get(3)), i = new xt(n.popFirst(5));\\n        return s.isEqual(e) || \\n        // TODO(b/64130202): Somehow support foreign references.\\n        F(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`), \\n        i;\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Converts custom model object of type T into `DocumentData` by applying the\\n * converter if it exists.\\n *\\n * This function is used when converting user objects to `DocumentData`\\n * because we want to provide the user with a more specific error message if\\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\\n * call.\\n */ function Yh(t, e, n) {\\n    let s;\\n    // Cast to `any` in order to satisfy the union type constraint on\\n    // toFirestore().\\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\\n    return s = t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e, \\n    s;\\n}\\n\\nclass Xh extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A write batch, used to perform multiple writes as a single atomic unit.\\n *\\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\\n * provides methods for adding writes to the write batch. None of the writes\\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\\n * called.\\n */ class Zh {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, \\n        this._dataReader = th(t);\\n    }\\n    set(t, e, n) {\\n        this._verifyNotCommitted();\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"WriteBatch.set\\\", s._key, i, null !== s.converter, n);\\n        return this._mutations.push(r.toMutation(s._key, An.none())), this;\\n    }\\n    update(t, e, n, ...s) {\\n        this._verifyNotCommitted();\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"WriteBatch.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"WriteBatch.update\\\", i._key, e), \\n        this._mutations.push(r.toMutation(i._key, An.exists(!0))), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `WriteBatch` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        this._verifyNotCommitted();\\n        const e = tl(t, this._firestore);\\n        return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;\\n    }\\n    /**\\n     * Commits all of the writes in this write batch as a single atomic unit.\\n     *\\n     * The result of these writes will only be reflected in document reads that\\n     * occur after the returned promise resolves. If the client is offline, the\\n     * write fails. If you would like to see local modifications or buffer writes\\n     * until the client is online, use the full Firestore SDK.\\n     *\\n     * @returns A `Promise` resolved once all of the writes in the batch have been\\n     * successfully written to the backend as an atomic unit (note that it won't\\n     * resolve while you're offline).\\n     */    commit() {\\n        return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();\\n    }\\n    _verifyNotCommitted() {\\n        if (this._committed) throw new Q(G.FAILED_PRECONDITION, \\\"A write batch can no longer be used after commit() has been called.\\\");\\n    }\\n}\\n\\nfunction tl(t, e) {\\n    if ((t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, \\\"Provided document reference is from a different Firestore instance.\\\");\\n    return t;\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\\n// legacy SDK.\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Reads the document referred to by this `DocumentReference`.\\n *\\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\\n * for data from the server, but it may return cached data or fail if you are\\n * offline and the server cannot be reached. To specify this behavior, invoke\\n * {@link getDocFromCache} or {@link getDocFromServer}.\\n *\\n * @param reference - The reference of the document to fetch.\\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */\\nfunction el(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key).then((n => wl(e, t, n)));\\n}\\n\\nclass nl extends Jh {\\n    constructor(t) {\\n        super(), this.firestore = t;\\n    }\\n    convertBytes(t) {\\n        return new Qc(t);\\n    }\\n    convertReference(t) {\\n        const e = this.convertDocumentKey(t, this.firestore._databaseId);\\n        return new wc(this.firestore, /* converter= */ null, e);\\n    }\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function sl(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations, \\n    /* fromCache= */ !0), t.converter)));\\n}\\n\\n/**\\n * Reads the document referred to by this `DocumentReference` from the server.\\n * Returns an error if the network is not available.\\n *\\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\\n * current document contents.\\n */ function il(t) {\\n    t = hc(t, wc);\\n    const e = hc(t.firestore, Vc);\\n    return Ya(Dc(e), t._key, {\\n        source: \\\"server\\\"\\n    }).then((n => wl(e, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot`.\\n *\\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\\n * waiting for data from the server, but it may return cached data or fail if\\n * you are offline and the server cannot be reached. To specify this behavior,\\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function rl(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\\n * Returns an error if the document is not currently cached.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ol(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Xa(n, t._query).then((n => new Ph(e, s, t, n)));\\n}\\n\\n/**\\n * Executes the query and returns the results as a `QuerySnapshot` from the\\n * server. Returns an error if the network is not available.\\n *\\n * @returns A `Promise` that will be resolved with the results of the query.\\n */ function ul(t) {\\n    t = hc(t, mc);\\n    const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);\\n    return Za(n, t._query, {\\n        source: \\\"server\\\"\\n    }).then((n => new Ph(e, s, t, n)));\\n}\\n\\nfunction al(t, e, n) {\\n    t = hc(t, wc);\\n    const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);\\n    return _l(s, [ eh(th(s), \\\"setDoc\\\", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);\\n}\\n\\nfunction cl(t, e, n, ...s) {\\n    t = hc(t, wc);\\n    const i = hc(t.firestore, Vc), r = th(i);\\n    let o;\\n    o = \\\"string\\\" == typeof (\\n    // For Compat types, we have to \\\"extract\\\" the underlying types before\\n    // performing validation.\\n    e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(r, \\\"updateDoc\\\", t._key, e, n, s) : ah(r, \\\"updateDoc\\\", t._key, e);\\n    return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);\\n}\\n\\n/**\\n * Deletes the document referred to by the specified `DocumentReference`.\\n *\\n * @param reference - A reference to the document to delete.\\n * @returns A Promise resolved once the document has been successfully\\n * deleted from the backend (note that it won't resolve while you're offline).\\n */ function hl(t) {\\n    return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);\\n}\\n\\n/**\\n * Add a new document to specified `CollectionReference` with the given data,\\n * assigning it a document ID automatically.\\n *\\n * @param reference - A reference to the collection to add this document to.\\n * @param data - An Object containing the data for the new document.\\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\\n * newly created document after it has been written to the backend (Note that it\\n * won't resolve while you're offline).\\n */ function ll(t, e) {\\n    const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);\\n    return _l(n, [ eh(th(t.firestore), \\\"addDoc\\\", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));\\n}\\n\\nfunction fl(t, ...e) {\\n    var n, s, i;\\n    t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(t);\\n    let r = {\\n        includeMetadataChanges: !1\\n    }, o = 0;\\n    \\\"object\\\" != typeof e[o] || Rc(e[o]) || (r = e[o], o++);\\n    const u = {\\n        includeMetadataChanges: r.includeMetadataChanges\\n    };\\n    if (Rc(e[o])) {\\n        const t = e[o];\\n        e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t), \\n        e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);\\n    }\\n    let a, c, h;\\n    if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {\\n        next: n => {\\n            e[o] && e[o](wl(c, t, n));\\n        },\\n        error: e[o + 1],\\n        complete: e[o + 2]\\n    }; else {\\n        const n = hc(t, mc);\\n        c = hc(n.firestore, Vc), h = n._query;\\n        const s = new nl(c);\\n        a = {\\n            next: t => {\\n                e[o] && e[o](new Ph(c, s, n, t));\\n            },\\n            error: e[o + 1],\\n            complete: e[o + 2]\\n        }, Sh(t._query);\\n    }\\n    return function(t, e, n, s) {\\n        const i = new ka(s), r = new Lu(e, i, n);\\n        return t.asyncQueue.enqueueAndForget((async () => Mu(await Wa(t), r))), () => {\\n            i.Aa(), t.asyncQueue.enqueueAndForget((async () => Ou(await Wa(t), r)));\\n        };\\n    }(Dc(c), h, u, a);\\n}\\n\\nfunction dl(t, e) {\\n    return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {\\n        next: e\\n    });\\n}\\n\\n/**\\n * Locally writes `mutations` on the async queue.\\n * @internal\\n */ function _l(t, e) {\\n    return function(t, e) {\\n        const n = new j;\\n        return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;\\n    }(Dc(t), e);\\n}\\n\\n/**\\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\\n * to a {@link DocumentSnapshot}.\\n */ function wl(t, e, n) {\\n    const s = n.docs.get(e._key), i = new nl(t);\\n    return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * A reference to a transaction.\\n *\\n * The `Transaction` object passed to a transaction's `updateFunction` provides\\n * the methods to read and write data within the transaction context. See\\n * {@link runTransaction}.\\n */ class ml extends class {\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        this._firestore = t, this._transaction = e, this._dataReader = th(t);\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new Xh(this._firestore);\\n        return this._transaction.lookup([ e._key ]).then((t => {\\n            if (!t || 1 !== t.length) return L();\\n            const s = t[0];\\n            if (s.isFoundDocument()) return new Ih(this._firestore, n, s.key, s, e.converter);\\n            if (s.isNoDocument()) return new Ih(this._firestore, n, e._key, null, e.converter);\\n            throw L();\\n        }));\\n    }\\n    set(t, e, n) {\\n        const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, \\\"Transaction.set\\\", s._key, i, null !== s.converter, n);\\n        return this._transaction.set(s._key, r), this;\\n    }\\n    update(t, e, n, ...s) {\\n        const i = tl(t, this._firestore);\\n        // For Compat types, we have to \\\"extract\\\" the underlying types before\\n        // performing validation.\\n                let r;\\n        return r = \\\"string\\\" == typeof (e = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_3__.getModularInstance)(e)) || e instanceof Kc ? ch(this._dataReader, \\\"Transaction.update\\\", i._key, e, n, s) : ah(this._dataReader, \\\"Transaction.update\\\", i._key, e), \\n        this._transaction.update(i._key, r), this;\\n    }\\n    /**\\n     * Deletes the document referred to by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be deleted.\\n     * @returns This `Transaction` instance. Used for chaining method calls.\\n     */    delete(t) {\\n        const e = tl(t, this._firestore);\\n        return this._transaction.delete(e._key), this;\\n    }\\n} {\\n    // This class implements the same logic as the Transaction API in the Lite SDK\\n    // but is subclassed in order to return its own DocumentSnapshot types.\\n    /** @hideconstructor */\\n    constructor(t, e) {\\n        super(t, e), this._firestore = t;\\n    }\\n    /**\\n     * Reads the document referenced by the provided {@link DocumentReference}.\\n     *\\n     * @param documentRef - A reference to the document to be read.\\n     * @returns A `DocumentSnapshot` with the read data.\\n     */    get(t) {\\n        const e = tl(t, this._firestore), n = new nl(this._firestore);\\n        return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(\\n        /* hasPendingWrites= */ !1, \\n        /* fromCache= */ !1), e.converter)));\\n    }\\n}\\n\\n/**\\n * Executes the given `updateFunction` and then attempts to commit the changes\\n * applied within the transaction. If any document read within the transaction\\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\\n * commit after 5 attempts, the transaction fails.\\n *\\n * The maximum number of writes allowed in a single transaction is 500.\\n *\\n * @param firestore - A reference to the Firestore database to run this\\n * transaction against.\\n * @param updateFunction - The function to execute within the transaction\\n * context.\\n * @returns If the transaction completed successfully or was explicitly aborted\\n * (the `updateFunction` returned a failed promise), the promise returned by the\\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\\n * rejected promise with the corresponding failure error is returned.\\n */ function gl(t, e, n) {\\n    t = hc(t, Vc);\\n    const s = Object.assign(Object.assign({}, Hh), n);\\n    !function(t) {\\n        if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, \\\"Max attempts must be at least 1\\\");\\n    }(s);\\n    return ec(Dc(t), (n => e(new ml(t, n))), s);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\\n */ function yl() {\\n    return new nh(\\\"deleteField\\\");\\n}\\n\\n/**\\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\\n * include a server-generated timestamp in the written data.\\n */ function pl() {\\n    return new ih(\\\"serverTimestamp\\\");\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\\n * value that already exists on the server. Each specified element that doesn't\\n * already exist in the array will be added to the end. If the field being\\n * modified is not already an array it will be overwritten with an array\\n * containing exactly the specified elements.\\n *\\n * @param elements - The elements to union into the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`.\\n */ function Il(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new rh(\\\"arrayUnion\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\\n * updateDoc:1} that tells the server to remove the given elements from any\\n * array value that already exists on the server. All instances of each element\\n * specified will be removed from the array. If the field being modified is not\\n * already an array it will be overwritten with an empty array.\\n *\\n * @param elements - The elements to remove from the array.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function Tl(...t) {\\n    // NOTE: We don't actually parse the data until it's used in set() or\\n    // update() since we'd need the Firestore instance to do this.\\n    return new oh(\\\"arrayRemove\\\", t);\\n}\\n\\n/**\\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\\n * the given value.\\n *\\n * If either the operand or the current field value uses floating point\\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\\n * integers, values outside of JavaScript's safe number range\\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\\n * precision loss. Furthermore, once processed by the Firestore backend, all\\n * integer operations are capped between -2^63 and 2^63-1.\\n *\\n * If the current field value is not of type `number`, or if the field does not\\n * yet exist, the transformation sets the field to the given value.\\n *\\n * @param n - The value to increment by.\\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\\n * `updateDoc()`\\n */ function El(t) {\\n    return new uh(\\\"increment\\\", t);\\n}\\n\\n/**\\n * @license\\n * Copyright 2020 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n/**\\n * Creates a write batch, used for performing multiple writes as a single\\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\\n * is 500.\\n *\\n * Unlike transactions, write batches are persisted offline and therefore are\\n * preferable when you don't need to condition your writes on read data.\\n *\\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\\n * writes.\\n */ function Al(t) {\\n    return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));\\n}\\n\\n/**\\n * @license\\n * Copyright 2021 Google LLC\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *   http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */ function Rl(t, e) {\\n    Dc(t = hc(t, Vc));\\n    const n = \\\"string\\\" == typeof e ? function(t) {\\n        try {\\n            return JSON.parse(t);\\n        } catch (t) {\\n            throw new Q(G.INVALID_ARGUMENT, \\\"Failed to parse JSON:\\\" + t.message);\\n        }\\n    }(e) : e, s = [];\\n    // PORTING NOTE: We don't return an error if the user has not enabled\\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\\n    if (Array.isArray(n.indexes)) for (const t of n.indexes) {\\n        const e = bl(t, \\\"collectionGroup\\\"), n = [];\\n        if (Array.isArray(t.fields)) for (const e of t.fields) {\\n            const t = gh(\\\"setIndexConfiguration\\\", bl(e, \\\"fieldPath\\\"));\\n            \\\"CONTAINS\\\" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : \\\"ASCENDING\\\" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : \\\"DESCENDING\\\" === e.order && n.push(new oe(t, 1 /* DESCENDING */));\\n        }\\n        s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));\\n    }\\n    // TODO(indexing): Configure indexes\\n        return Promise.resolve();\\n}\\n\\nfunction bl(t, e) {\\n    if (\\\"string\\\" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, \\\"Missing string value for: \\\" + e);\\n    return t[e];\\n}\\n\\n/**\\n * Cloud Firestore\\n *\\n * @packageDocumentation\\n */ !function(t, e = !0) {\\n    !function(t) {\\n        x = t;\\n    }(_firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent)(new _firebase_component__WEBPACK_IMPORTED_MODULE_1__.Component(\\\"firestore\\\", ((t, {options: n}) => {\\n        const s = t.getProvider(\\\"app\\\").getImmediate(), i = new Vc(s, new J(t.getProvider(\\\"auth-internal\\\")), new tt(t.getProvider(\\\"app-check-internal\\\")));\\n        return n = Object.assign({\\n            useFetchStreams: e\\n        }, n), i._setSettings(n), i;\\n    }), \\\"PUBLIC\\\")), (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", t), \\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\n    (0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(D, \\\"3.4.9\\\", \\\"esm2017\\\");\\n}();\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/firestore/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/util/dist/index.esm2017.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/@firebase/util/dist/index.esm2017.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"CONSTANTS\\\": () => (/* binding */ CONSTANTS),\\n/* harmony export */   \\\"Deferred\\\": () => (/* binding */ Deferred),\\n/* harmony export */   \\\"ErrorFactory\\\": () => (/* binding */ ErrorFactory),\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* binding */ FirebaseError),\\n/* harmony export */   \\\"MAX_VALUE_MILLIS\\\": () => (/* binding */ MAX_VALUE_MILLIS),\\n/* harmony export */   \\\"RANDOM_FACTOR\\\": () => (/* binding */ RANDOM_FACTOR),\\n/* harmony export */   \\\"Sha1\\\": () => (/* binding */ Sha1),\\n/* harmony export */   \\\"areCookiesEnabled\\\": () => (/* binding */ areCookiesEnabled),\\n/* harmony export */   \\\"assert\\\": () => (/* binding */ assert),\\n/* harmony export */   \\\"assertionError\\\": () => (/* binding */ assertionError),\\n/* harmony export */   \\\"async\\\": () => (/* binding */ async),\\n/* harmony export */   \\\"base64\\\": () => (/* binding */ base64),\\n/* harmony export */   \\\"base64Decode\\\": () => (/* binding */ base64Decode),\\n/* harmony export */   \\\"base64Encode\\\": () => (/* binding */ base64Encode),\\n/* harmony export */   \\\"base64urlEncodeWithoutPadding\\\": () => (/* binding */ base64urlEncodeWithoutPadding),\\n/* harmony export */   \\\"calculateBackoffMillis\\\": () => (/* binding */ calculateBackoffMillis),\\n/* harmony export */   \\\"contains\\\": () => (/* binding */ contains),\\n/* harmony export */   \\\"createMockUserToken\\\": () => (/* binding */ createMockUserToken),\\n/* harmony export */   \\\"createSubscribe\\\": () => (/* binding */ createSubscribe),\\n/* harmony export */   \\\"decode\\\": () => (/* binding */ decode),\\n/* harmony export */   \\\"deepCopy\\\": () => (/* binding */ deepCopy),\\n/* harmony export */   \\\"deepEqual\\\": () => (/* binding */ deepEqual),\\n/* harmony export */   \\\"deepExtend\\\": () => (/* binding */ deepExtend),\\n/* harmony export */   \\\"errorPrefix\\\": () => (/* binding */ errorPrefix),\\n/* harmony export */   \\\"extractQuerystring\\\": () => (/* binding */ extractQuerystring),\\n/* harmony export */   \\\"getGlobal\\\": () => (/* binding */ getGlobal),\\n/* harmony export */   \\\"getModularInstance\\\": () => (/* binding */ getModularInstance),\\n/* harmony export */   \\\"getUA\\\": () => (/* binding */ getUA),\\n/* harmony export */   \\\"isAdmin\\\": () => (/* binding */ isAdmin),\\n/* harmony export */   \\\"isBrowser\\\": () => (/* binding */ isBrowser),\\n/* harmony export */   \\\"isBrowserExtension\\\": () => (/* binding */ isBrowserExtension),\\n/* harmony export */   \\\"isElectron\\\": () => (/* binding */ isElectron),\\n/* harmony export */   \\\"isEmpty\\\": () => (/* binding */ isEmpty),\\n/* harmony export */   \\\"isIE\\\": () => (/* binding */ isIE),\\n/* harmony export */   \\\"isIndexedDBAvailable\\\": () => (/* binding */ isIndexedDBAvailable),\\n/* harmony export */   \\\"isMobileCordova\\\": () => (/* binding */ isMobileCordova),\\n/* harmony export */   \\\"isNode\\\": () => (/* binding */ isNode),\\n/* harmony export */   \\\"isNodeSdk\\\": () => (/* binding */ isNodeSdk),\\n/* harmony export */   \\\"isReactNative\\\": () => (/* binding */ isReactNative),\\n/* harmony export */   \\\"isSafari\\\": () => (/* binding */ isSafari),\\n/* harmony export */   \\\"isUWP\\\": () => (/* binding */ isUWP),\\n/* harmony export */   \\\"isValidFormat\\\": () => (/* binding */ isValidFormat),\\n/* harmony export */   \\\"isValidTimestamp\\\": () => (/* binding */ isValidTimestamp),\\n/* harmony export */   \\\"issuedAtTime\\\": () => (/* binding */ issuedAtTime),\\n/* harmony export */   \\\"jsonEval\\\": () => (/* binding */ jsonEval),\\n/* harmony export */   \\\"map\\\": () => (/* binding */ map),\\n/* harmony export */   \\\"ordinal\\\": () => (/* binding */ ordinal),\\n/* harmony export */   \\\"querystring\\\": () => (/* binding */ querystring),\\n/* harmony export */   \\\"querystringDecode\\\": () => (/* binding */ querystringDecode),\\n/* harmony export */   \\\"safeGet\\\": () => (/* binding */ safeGet),\\n/* harmony export */   \\\"stringLength\\\": () => (/* binding */ stringLength),\\n/* harmony export */   \\\"stringToByteArray\\\": () => (/* binding */ stringToByteArray),\\n/* harmony export */   \\\"stringify\\\": () => (/* binding */ stringify),\\n/* harmony export */   \\\"validateArgCount\\\": () => (/* binding */ validateArgCount),\\n/* harmony export */   \\\"validateCallback\\\": () => (/* binding */ validateCallback),\\n/* harmony export */   \\\"validateContextObject\\\": () => (/* binding */ validateContextObject),\\n/* harmony export */   \\\"validateIndexedDBOpenable\\\": () => (/* binding */ validateIndexedDBOpenable),\\n/* harmony export */   \\\"validateNamespace\\\": () => (/* binding */ validateNamespace)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Firebase constants.  Some of these (@defines) can be overridden at compile-time.\\r\\n */\\r\\nconst CONSTANTS = {\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the client Node.js SDK.\\r\\n     */\\r\\n    NODE_CLIENT: false,\\r\\n    /**\\r\\n     * @define {boolean} Whether this is the Admin Node.js SDK.\\r\\n     */\\r\\n    NODE_ADMIN: false,\\r\\n    /**\\r\\n     * Firebase SDK Version\\r\\n     */\\r\\n    SDK_VERSION: '${JSCORE_VERSION}'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Throws an error if the provided assertion is falsy\\r\\n */\\r\\nconst assert = function (assertion, message) {\\r\\n    if (!assertion) {\\r\\n        throw assertionError(message);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Returns an Error object suitable for throwing.\\r\\n */\\r\\nconst assertionError = function (message) {\\r\\n    return new Error('Firebase Database (' +\\r\\n        CONSTANTS.SDK_VERSION +\\r\\n        ') INTERNAL ASSERT FAILED: ' +\\r\\n        message);\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst stringToByteArray$1 = function (str) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if ((c & 0xfc00) === 0xd800 &&\\r\\n            i + 1 < str.length &&\\r\\n            (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\\r\\n            // Surrogate Pair\\r\\n            c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Turns an array of numbers into the string given by the concatenation of the\\r\\n * characters to which the numbers correspond.\\r\\n * @param bytes Array of numbers representing characters.\\r\\n * @return Stringification of the array.\\r\\n */\\r\\nconst byteArrayToString = function (bytes) {\\r\\n    // TODO(user): Use native implementations if/when available\\r\\n    const out = [];\\r\\n    let pos = 0, c = 0;\\r\\n    while (pos < bytes.length) {\\r\\n        const c1 = bytes[pos++];\\r\\n        if (c1 < 128) {\\r\\n            out[c++] = String.fromCharCode(c1);\\r\\n        }\\r\\n        else if (c1 > 191 && c1 < 224) {\\r\\n            const c2 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\\r\\n        }\\r\\n        else if (c1 > 239 && c1 < 365) {\\r\\n            // Surrogate Pair\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            const c4 = bytes[pos++];\\r\\n            const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\\r\\n                0x10000;\\r\\n            out[c++] = String.fromCharCode(0xd800 + (u >> 10));\\r\\n            out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\\r\\n        }\\r\\n        else {\\r\\n            const c2 = bytes[pos++];\\r\\n            const c3 = bytes[pos++];\\r\\n            out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\\r\\n        }\\r\\n    }\\r\\n    return out.join('');\\r\\n};\\r\\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\\r\\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\\r\\n// Static lookup maps, lazily populated by init_()\\r\\nconst base64 = {\\r\\n    /**\\r\\n     * Maps bytes to characters.\\r\\n     */\\r\\n    byteToCharMap_: null,\\r\\n    /**\\r\\n     * Maps characters to bytes.\\r\\n     */\\r\\n    charToByteMap_: null,\\r\\n    /**\\r\\n     * Maps bytes to websafe characters.\\r\\n     * @private\\r\\n     */\\r\\n    byteToCharMapWebSafe_: null,\\r\\n    /**\\r\\n     * Maps websafe characters to bytes.\\r\\n     * @private\\r\\n     */\\r\\n    charToByteMapWebSafe_: null,\\r\\n    /**\\r\\n     * Our default alphabet, shared between\\r\\n     * ENCODED_VALS and ENCODED_VALS_WEBSAFE\\r\\n     */\\r\\n    ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\\r\\n    /**\\r\\n     * Our default alphabet. Value 64 (=) is special; it means \\\"nothing.\\\"\\r\\n     */\\r\\n    get ENCODED_VALS() {\\r\\n        return this.ENCODED_VALS_BASE + '+/=';\\r\\n    },\\r\\n    /**\\r\\n     * Our websafe alphabet.\\r\\n     */\\r\\n    get ENCODED_VALS_WEBSAFE() {\\r\\n        return this.ENCODED_VALS_BASE + '-_.';\\r\\n    },\\r\\n    /**\\r\\n     * Whether this browser supports the atob and btoa functions. This extension\\r\\n     * started at Mozilla but is now implemented by many browsers. We use the\\r\\n     * ASSUME_* variables to avoid pulling in the full useragent detection library\\r\\n     * but still allowing the standard per-browser compilations.\\r\\n     *\\r\\n     */\\r\\n    HAS_NATIVE_SUPPORT: typeof atob === 'function',\\r\\n    /**\\r\\n     * Base64-encode an array of bytes.\\r\\n     *\\r\\n     * @param input An array of bytes (numbers with\\r\\n     *     value in [0, 255]) to encode.\\r\\n     * @param webSafe Boolean indicating we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeByteArray(input, webSafe) {\\r\\n        if (!Array.isArray(input)) {\\r\\n            throw Error('encodeByteArray takes an array as a parameter');\\r\\n        }\\r\\n        this.init_();\\r\\n        const byteToCharMap = webSafe\\r\\n            ? this.byteToCharMapWebSafe_\\r\\n            : this.byteToCharMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length; i += 3) {\\r\\n            const byte1 = input[i];\\r\\n            const haveByte2 = i + 1 < input.length;\\r\\n            const byte2 = haveByte2 ? input[i + 1] : 0;\\r\\n            const haveByte3 = i + 2 < input.length;\\r\\n            const byte3 = haveByte3 ? input[i + 2] : 0;\\r\\n            const outByte1 = byte1 >> 2;\\r\\n            const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\\r\\n            let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\\r\\n            let outByte4 = byte3 & 0x3f;\\r\\n            if (!haveByte3) {\\r\\n                outByte4 = 64;\\r\\n                if (!haveByte2) {\\r\\n                    outByte3 = 64;\\r\\n                }\\r\\n            }\\r\\n            output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\\r\\n        }\\r\\n        return output.join('');\\r\\n    },\\r\\n    /**\\r\\n     * Base64-encode a string.\\r\\n     *\\r\\n     * @param input A string to encode.\\r\\n     * @param webSafe If true, we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return The base64 encoded string.\\r\\n     */\\r\\n    encodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return btoa(input);\\r\\n        }\\r\\n        return this.encodeByteArray(stringToByteArray$1(input), webSafe);\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * @param input to decode.\\r\\n     * @param webSafe True if we should use the\\r\\n     *     alternative alphabet.\\r\\n     * @return string representing the decoded value.\\r\\n     */\\r\\n    decodeString(input, webSafe) {\\r\\n        // Shortcut for Mozilla browsers that implement\\r\\n        // a native base64 encoder in the form of \\\"btoa/atob\\\"\\r\\n        if (this.HAS_NATIVE_SUPPORT && !webSafe) {\\r\\n            return atob(input);\\r\\n        }\\r\\n        return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\\r\\n    },\\r\\n    /**\\r\\n     * Base64-decode a string.\\r\\n     *\\r\\n     * In base-64 decoding, groups of four characters are converted into three\\r\\n     * bytes.  If the encoder did not apply padding, the input length may not\\r\\n     * be a multiple of 4.\\r\\n     *\\r\\n     * In this case, the last group will have fewer than 4 characters, and\\r\\n     * padding will be inferred.  If the group has one or two characters, it decodes\\r\\n     * to one byte.  If the group has three characters, it decodes to two bytes.\\r\\n     *\\r\\n     * @param input Input to decode.\\r\\n     * @param webSafe True if we should use the web-safe alphabet.\\r\\n     * @return bytes representing the decoded value.\\r\\n     */\\r\\n    decodeStringToByteArray(input, webSafe) {\\r\\n        this.init_();\\r\\n        const charToByteMap = webSafe\\r\\n            ? this.charToByteMapWebSafe_\\r\\n            : this.charToByteMap_;\\r\\n        const output = [];\\r\\n        for (let i = 0; i < input.length;) {\\r\\n            const byte1 = charToByteMap[input.charAt(i++)];\\r\\n            const haveByte2 = i < input.length;\\r\\n            const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\\r\\n            ++i;\\r\\n            const haveByte3 = i < input.length;\\r\\n            const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            const haveByte4 = i < input.length;\\r\\n            const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\\r\\n            ++i;\\r\\n            if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\\r\\n                throw Error();\\r\\n            }\\r\\n            const outByte1 = (byte1 << 2) | (byte2 >> 4);\\r\\n            output.push(outByte1);\\r\\n            if (byte3 !== 64) {\\r\\n                const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\\r\\n                output.push(outByte2);\\r\\n                if (byte4 !== 64) {\\r\\n                    const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\\r\\n                    output.push(outByte3);\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return output;\\r\\n    },\\r\\n    /**\\r\\n     * Lazy static initialization function. Called before\\r\\n     * accessing any of the static map variables.\\r\\n     * @private\\r\\n     */\\r\\n    init_() {\\r\\n        if (!this.byteToCharMap_) {\\r\\n            this.byteToCharMap_ = {};\\r\\n            this.charToByteMap_ = {};\\r\\n            this.byteToCharMapWebSafe_ = {};\\r\\n            this.charToByteMapWebSafe_ = {};\\r\\n            // We want quick mappings back and forth, so we precompute two maps.\\r\\n            for (let i = 0; i < this.ENCODED_VALS.length; i++) {\\r\\n                this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\\r\\n                this.charToByteMap_[this.byteToCharMap_[i]] = i;\\r\\n                this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\\r\\n                this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\\r\\n                // Be forgiving when decoding and correctly decode both encodings.\\r\\n                if (i >= this.ENCODED_VALS_BASE.length) {\\r\\n                    this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\\r\\n                    this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding\\r\\n */\\r\\nconst base64Encode = function (str) {\\r\\n    const utf8Bytes = stringToByteArray$1(str);\\r\\n    return base64.encodeByteArray(utf8Bytes, true);\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 encoding (without \\\".\\\" padding in the end).\\r\\n * e.g. Used in JSON Web Token (JWT) parts.\\r\\n */\\r\\nconst base64urlEncodeWithoutPadding = function (str) {\\r\\n    // Use base64url encoding and remove padding in the end (dot characters).\\r\\n    return base64Encode(str).replace(/\\\\./g, '');\\r\\n};\\r\\n/**\\r\\n * URL-safe base64 decoding\\r\\n *\\r\\n * NOTE: DO NOT use the global atob() function - it does NOT support the\\r\\n * base64Url variant encoding.\\r\\n *\\r\\n * @param str To be decoded\\r\\n * @return Decoded result, if possible\\r\\n */\\r\\nconst base64Decode = function (str) {\\r\\n    try {\\r\\n        return base64.decodeString(str, true);\\r\\n    }\\r\\n    catch (e) {\\r\\n        console.error('base64Decode failed: ', e);\\r\\n    }\\r\\n    return null;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Do a deep-copy of basic JavaScript Objects or Arrays.\\r\\n */\\r\\nfunction deepCopy(value) {\\r\\n    return deepExtend(undefined, value);\\r\\n}\\r\\n/**\\r\\n * Copy properties from source to target (recursively allows extension\\r\\n * of Objects and Arrays).  Scalar values in the target are over-written.\\r\\n * If target is undefined, an object of the appropriate type will be created\\r\\n * (and returned).\\r\\n *\\r\\n * We recursively copy all child properties of plain Objects in the source- so\\r\\n * that namespace- like dictionaries are merged.\\r\\n *\\r\\n * Note that the target can be a function, in which case the properties in\\r\\n * the source Object are copied onto it as static properties of the Function.\\r\\n *\\r\\n * Note: we don't merge __proto__ to prevent prototype pollution\\r\\n */\\r\\nfunction deepExtend(target, source) {\\r\\n    if (!(source instanceof Object)) {\\r\\n        return source;\\r\\n    }\\r\\n    switch (source.constructor) {\\r\\n        case Date:\\r\\n            // Treat Dates like scalars; if the target date object had any child\\r\\n            // properties - they will be lost!\\r\\n            const dateValue = source;\\r\\n            return new Date(dateValue.getTime());\\r\\n        case Object:\\r\\n            if (target === undefined) {\\r\\n                target = {};\\r\\n            }\\r\\n            break;\\r\\n        case Array:\\r\\n            // Always copy the array source and overwrite the target.\\r\\n            target = [];\\r\\n            break;\\r\\n        default:\\r\\n            // Not a plain Object - treat it as a scalar.\\r\\n            return source;\\r\\n    }\\r\\n    for (const prop in source) {\\r\\n        // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\\r\\n        if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\\r\\n            continue;\\r\\n        }\\r\\n        target[prop] = deepExtend(target[prop], source[prop]);\\r\\n    }\\r\\n    return target;\\r\\n}\\r\\nfunction isValidKey(key) {\\r\\n    return key !== '__proto__';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass Deferred {\\r\\n    constructor() {\\r\\n        this.reject = () => { };\\r\\n        this.resolve = () => { };\\r\\n        this.promise = new Promise((resolve, reject) => {\\r\\n            this.resolve = resolve;\\r\\n            this.reject = reject;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\\r\\n     * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\\r\\n     * and returns a node-style callback which will resolve or reject the Deferred's promise.\\r\\n     */\\r\\n    wrapCallback(callback) {\\r\\n        return (error, value) => {\\r\\n            if (error) {\\r\\n                this.reject(error);\\r\\n            }\\r\\n            else {\\r\\n                this.resolve(value);\\r\\n            }\\r\\n            if (typeof callback === 'function') {\\r\\n                // Attaching noop handler just in case developer wasn't expecting\\r\\n                // promises\\r\\n                this.promise.catch(() => { });\\r\\n                // Some of our callbacks don't expect a value and our own tests\\r\\n                // assert that the parameter length is 1\\r\\n                if (callback.length === 1) {\\r\\n                    callback(error);\\r\\n                }\\r\\n                else {\\r\\n                    callback(error, value);\\r\\n                }\\r\\n            }\\r\\n        };\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction createMockUserToken(token, projectId) {\\r\\n    if (token.uid) {\\r\\n        throw new Error('The \\\"uid\\\" field is no longer supported by mockUserToken. Please use \\\"sub\\\" instead for Firebase Auth User ID.');\\r\\n    }\\r\\n    // Unsecured JWTs use \\\"none\\\" as the algorithm.\\r\\n    const header = {\\r\\n        alg: 'none',\\r\\n        type: 'JWT'\\r\\n    };\\r\\n    const project = projectId || 'demo-project';\\r\\n    const iat = token.iat || 0;\\r\\n    const sub = token.sub || token.user_id;\\r\\n    if (!sub) {\\r\\n        throw new Error(\\\"mockUserToken must contain 'sub' or 'user_id' field!\\\");\\r\\n    }\\r\\n    const payload = Object.assign({ \\r\\n        // Set all required fields to decent defaults\\r\\n        iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\\r\\n            sign_in_provider: 'custom',\\r\\n            identities: {}\\r\\n        } }, token);\\r\\n    // Unsecured JWTs use the empty string as a signature.\\r\\n    const signature = '';\\r\\n    return [\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(header)),\\r\\n        base64urlEncodeWithoutPadding(JSON.stringify(payload)),\\r\\n        signature\\r\\n    ].join('.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns navigator.userAgent string or '' if it's not defined.\\r\\n * @return user agent string\\r\\n */\\r\\nfunction getUA() {\\r\\n    if (typeof navigator !== 'undefined' &&\\r\\n        typeof navigator['userAgent'] === 'string') {\\r\\n        return navigator['userAgent'];\\r\\n    }\\r\\n    else {\\r\\n        return '';\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\\r\\n *\\r\\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\\r\\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\\r\\n * wait for a callback.\\r\\n */\\r\\nfunction isMobileCordova() {\\r\\n    return (typeof window !== 'undefined' &&\\r\\n        // @ts-ignore Setting up an broadly applicable index signature for Window\\r\\n        // just to deal with this case would probably be a bad idea.\\r\\n        !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\\r\\n        /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\\r\\n}\\r\\n/**\\r\\n * Detect Node.js.\\r\\n *\\r\\n * @return true if Node.js environment is detected.\\r\\n */\\r\\n// Node detection logic from: https://github.com/iliakan/detect-node/\\r\\nfunction isNode() {\\r\\n    try {\\r\\n        return (Object.prototype.toString.call(__webpack_require__.g.process) === '[object process]');\\r\\n    }\\r\\n    catch (e) {\\r\\n        return false;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Detect Browser Environment\\r\\n */\\r\\nfunction isBrowser() {\\r\\n    return typeof self === 'object' && self.self === self;\\r\\n}\\r\\nfunction isBrowserExtension() {\\r\\n    const runtime = typeof chrome === 'object'\\r\\n        ? chrome.runtime\\r\\n        : typeof browser === 'object'\\r\\n            ? browser.runtime\\r\\n            : undefined;\\r\\n    return typeof runtime === 'object' && runtime.id !== undefined;\\r\\n}\\r\\n/**\\r\\n * Detect React Native.\\r\\n *\\r\\n * @return true if ReactNative environment is detected.\\r\\n */\\r\\nfunction isReactNative() {\\r\\n    return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\\r\\n}\\r\\n/** Detects Electron apps. */\\r\\nfunction isElectron() {\\r\\n    return getUA().indexOf('Electron/') >= 0;\\r\\n}\\r\\n/** Detects Internet Explorer. */\\r\\nfunction isIE() {\\r\\n    const ua = getUA();\\r\\n    return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\\r\\n}\\r\\n/** Detects Universal Windows Platform apps. */\\r\\nfunction isUWP() {\\r\\n    return getUA().indexOf('MSAppHost/') >= 0;\\r\\n}\\r\\n/**\\r\\n * Detect whether the current SDK build is the Node version.\\r\\n *\\r\\n * @return true if it's the Node SDK build.\\r\\n */\\r\\nfunction isNodeSdk() {\\r\\n    return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\\r\\n}\\r\\n/** Returns true if we are running in Safari. */\\r\\nfunction isSafari() {\\r\\n    return (!isNode() &&\\r\\n        navigator.userAgent.includes('Safari') &&\\r\\n        !navigator.userAgent.includes('Chrome'));\\r\\n}\\r\\n/**\\r\\n * This method checks if indexedDB is supported by current browser/service worker context\\r\\n * @return true if indexedDB is supported by current browser/service worker context\\r\\n */\\r\\nfunction isIndexedDBAvailable() {\\r\\n    return typeof indexedDB === 'object';\\r\\n}\\r\\n/**\\r\\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\\r\\n * if errors occur during the database open operation.\\r\\n *\\r\\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\\r\\n * private browsing)\\r\\n */\\r\\nfunction validateIndexedDBOpenable() {\\r\\n    return new Promise((resolve, reject) => {\\r\\n        try {\\r\\n            let preExist = true;\\r\\n            const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\\r\\n            const request = self.indexedDB.open(DB_CHECK_NAME);\\r\\n            request.onsuccess = () => {\\r\\n                request.result.close();\\r\\n                // delete database only when it doesn't pre-exist\\r\\n                if (!preExist) {\\r\\n                    self.indexedDB.deleteDatabase(DB_CHECK_NAME);\\r\\n                }\\r\\n                resolve(true);\\r\\n            };\\r\\n            request.onupgradeneeded = () => {\\r\\n                preExist = false;\\r\\n            };\\r\\n            request.onerror = () => {\\r\\n                var _a;\\r\\n                reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\\r\\n            };\\r\\n        }\\r\\n        catch (error) {\\r\\n            reject(error);\\r\\n        }\\r\\n    });\\r\\n}\\r\\n/**\\r\\n *\\r\\n * This method checks whether cookie is enabled within current browser\\r\\n * @return true if cookie is enabled within current browser\\r\\n */\\r\\nfunction areCookiesEnabled() {\\r\\n    if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\\r\\n        return false;\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n * Polyfill for `globalThis` object.\\r\\n * @returns the `globalThis` object for the given environment.\\r\\n */\\r\\nfunction getGlobal() {\\r\\n    if (typeof self !== 'undefined') {\\r\\n        return self;\\r\\n    }\\r\\n    if (typeof window !== 'undefined') {\\r\\n        return window;\\r\\n    }\\r\\n    if (typeof __webpack_require__.g !== 'undefined') {\\r\\n        return __webpack_require__.g;\\r\\n    }\\r\\n    throw new Error('Unable to locate global object.');\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview Standardized Firebase Error.\\r\\n *\\r\\n * Usage:\\r\\n *\\r\\n *   // Typescript string literals for type-safe codes\\r\\n *   type Err =\\r\\n *     'unknown' |\\r\\n *     'object-not-found'\\r\\n *     ;\\r\\n *\\r\\n *   // Closure enum for type-safe error codes\\r\\n *   // at-enum {string}\\r\\n *   var Err = {\\r\\n *     UNKNOWN: 'unknown',\\r\\n *     OBJECT_NOT_FOUND: 'object-not-found',\\r\\n *   }\\r\\n *\\r\\n *   let errors: Map<Err, string> = {\\r\\n *     'generic-error': \\\"Unknown error\\\",\\r\\n *     'file-not-found': \\\"Could not find file: {$file}\\\",\\r\\n *   };\\r\\n *\\r\\n *   // Type-safe function - must pass a valid error code as param.\\r\\n *   let error = new ErrorFactory<Err>('service', 'Service', errors);\\r\\n *\\r\\n *   ...\\r\\n *   throw error.create(Err.GENERIC);\\r\\n *   ...\\r\\n *   throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\\r\\n *   ...\\r\\n *   // Service: Could not file file: foo.txt (service/file-not-found).\\r\\n *\\r\\n *   catch (e) {\\r\\n *     assert(e.message === \\\"Could not find file: foo.txt.\\\");\\r\\n *     if (e.code === 'service/file-not-found') {\\r\\n *       console.log(\\\"Could not read file: \\\" + e['file']);\\r\\n *     }\\r\\n *   }\\r\\n */\\r\\nconst ERROR_NAME = 'FirebaseError';\\r\\n// Based on code from:\\r\\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\\r\\nclass FirebaseError extends Error {\\r\\n    constructor(\\r\\n    /** The error code for this error. */\\r\\n    code, message, \\r\\n    /** Custom data for this error. */\\r\\n    customData) {\\r\\n        super(message);\\r\\n        this.code = code;\\r\\n        this.customData = customData;\\r\\n        /** The custom name for all FirebaseErrors. */\\r\\n        this.name = ERROR_NAME;\\r\\n        // Fix For ES5\\r\\n        // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\\r\\n        Object.setPrototypeOf(this, FirebaseError.prototype);\\r\\n        // Maintains proper stack trace for where our error was thrown.\\r\\n        // Only available on V8.\\r\\n        if (Error.captureStackTrace) {\\r\\n            Error.captureStackTrace(this, ErrorFactory.prototype.create);\\r\\n        }\\r\\n    }\\r\\n}\\r\\nclass ErrorFactory {\\r\\n    constructor(service, serviceName, errors) {\\r\\n        this.service = service;\\r\\n        this.serviceName = serviceName;\\r\\n        this.errors = errors;\\r\\n    }\\r\\n    create(code, ...data) {\\r\\n        const customData = data[0] || {};\\r\\n        const fullCode = `${this.service}/${code}`;\\r\\n        const template = this.errors[code];\\r\\n        const message = template ? replaceTemplate(template, customData) : 'Error';\\r\\n        // Service Name: Error message (service/code).\\r\\n        const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\\r\\n        const error = new FirebaseError(fullCode, fullMessage, customData);\\r\\n        return error;\\r\\n    }\\r\\n}\\r\\nfunction replaceTemplate(template, data) {\\r\\n    return template.replace(PATTERN, (_, key) => {\\r\\n        const value = data[key];\\r\\n        return value != null ? String(value) : `<${key}?>`;\\r\\n    });\\r\\n}\\r\\nconst PATTERN = /\\\\{\\\\$([^}]+)}/g;\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Evaluates a JSON string into a javascript object.\\r\\n *\\r\\n * @param {string} str A string containing JSON.\\r\\n * @return {*} The javascript object representing the specified JSON.\\r\\n */\\r\\nfunction jsonEval(str) {\\r\\n    return JSON.parse(str);\\r\\n}\\r\\n/**\\r\\n * Returns JSON representing a javascript object.\\r\\n * @param {*} data Javascript object to be stringified.\\r\\n * @return {string} The JSON contents of the object.\\r\\n */\\r\\nfunction stringify(data) {\\r\\n    return JSON.stringify(data);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Decodes a Firebase auth. token into constituent parts.\\r\\n *\\r\\n * Notes:\\r\\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst decode = function (token) {\\r\\n    let header = {}, claims = {}, data = {}, signature = '';\\r\\n    try {\\r\\n        const parts = token.split('.');\\r\\n        header = jsonEval(base64Decode(parts[0]) || '');\\r\\n        claims = jsonEval(base64Decode(parts[1]) || '');\\r\\n        signature = parts[2];\\r\\n        data = claims['d'] || {};\\r\\n        delete claims['d'];\\r\\n    }\\r\\n    catch (e) { }\\r\\n    return {\\r\\n        header,\\r\\n        claims,\\r\\n        data,\\r\\n        signature\\r\\n    };\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\\r\\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidTimestamp = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    const now = Math.floor(new Date().getTime() / 1000);\\r\\n    let validSince = 0, validUntil = 0;\\r\\n    if (typeof claims === 'object') {\\r\\n        if (claims.hasOwnProperty('nbf')) {\\r\\n            validSince = claims['nbf'];\\r\\n        }\\r\\n        else if (claims.hasOwnProperty('iat')) {\\r\\n            validSince = claims['iat'];\\r\\n        }\\r\\n        if (claims.hasOwnProperty('exp')) {\\r\\n            validUntil = claims['exp'];\\r\\n        }\\r\\n        else {\\r\\n            // token will expire after 24h by default\\r\\n            validUntil = validSince + 86400;\\r\\n        }\\r\\n    }\\r\\n    return (!!now &&\\r\\n        !!validSince &&\\r\\n        !!validUntil &&\\r\\n        now >= validSince &&\\r\\n        now <= validUntil);\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\\r\\n *\\r\\n * Notes:\\r\\n * - May return null if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst issuedAtTime = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\\r\\n        return claims['iat'];\\r\\n    }\\r\\n    return null;\\r\\n};\\r\\n/**\\r\\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isValidFormat = function (token) {\\r\\n    const decoded = decode(token), claims = decoded.claims;\\r\\n    return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\\r\\n};\\r\\n/**\\r\\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\\r\\n *\\r\\n * Notes:\\r\\n * - May return a false negative if there's no native base64 decoding support.\\r\\n * - Doesn't check if the token is actually valid.\\r\\n */\\r\\nconst isAdmin = function (token) {\\r\\n    const claims = decode(token).claims;\\r\\n    return typeof claims === 'object' && claims['admin'] === true;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction contains(obj, key) {\\r\\n    return Object.prototype.hasOwnProperty.call(obj, key);\\r\\n}\\r\\nfunction safeGet(obj, key) {\\r\\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n        return obj[key];\\r\\n    }\\r\\n    else {\\r\\n        return undefined;\\r\\n    }\\r\\n}\\r\\nfunction isEmpty(obj) {\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction map(obj, fn, contextObj) {\\r\\n    const res = {};\\r\\n    for (const key in obj) {\\r\\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\\r\\n            res[key] = fn.call(contextObj, obj[key], key, obj);\\r\\n        }\\r\\n    }\\r\\n    return res;\\r\\n}\\r\\n/**\\r\\n * Deep equal two objects. Support Arrays and Objects.\\r\\n */\\r\\nfunction deepEqual(a, b) {\\r\\n    if (a === b) {\\r\\n        return true;\\r\\n    }\\r\\n    const aKeys = Object.keys(a);\\r\\n    const bKeys = Object.keys(b);\\r\\n    for (const k of aKeys) {\\r\\n        if (!bKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n        const aProp = a[k];\\r\\n        const bProp = b[k];\\r\\n        if (isObject(aProp) && isObject(bProp)) {\\r\\n            if (!deepEqual(aProp, bProp)) {\\r\\n                return false;\\r\\n            }\\r\\n        }\\r\\n        else if (aProp !== bProp) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    for (const k of bKeys) {\\r\\n        if (!aKeys.includes(k)) {\\r\\n            return false;\\r\\n        }\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\nfunction isObject(thing) {\\r\\n    return thing !== null && typeof thing === 'object';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\\r\\n * params object (e.g. {arg: 'val', arg2: 'val2'})\\r\\n * Note: You must prepend it with ? when adding it to a URL.\\r\\n */\\r\\nfunction querystring(querystringParams) {\\r\\n    const params = [];\\r\\n    for (const [key, value] of Object.entries(querystringParams)) {\\r\\n        if (Array.isArray(value)) {\\r\\n            value.forEach(arrayVal => {\\r\\n                params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\\r\\n            });\\r\\n        }\\r\\n        else {\\r\\n            params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\\r\\n        }\\r\\n    }\\r\\n    return params.length ? '&' + params.join('&') : '';\\r\\n}\\r\\n/**\\r\\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\\r\\n * (e.g. {arg: 'val', arg2: 'val2'})\\r\\n */\\r\\nfunction querystringDecode(querystring) {\\r\\n    const obj = {};\\r\\n    const tokens = querystring.replace(/^\\\\?/, '').split('&');\\r\\n    tokens.forEach(token => {\\r\\n        if (token) {\\r\\n            const [key, value] = token.split('=');\\r\\n            obj[decodeURIComponent(key)] = decodeURIComponent(value);\\r\\n        }\\r\\n    });\\r\\n    return obj;\\r\\n}\\r\\n/**\\r\\n * Extract the query string part of a URL, including the leading question mark (if present).\\r\\n */\\r\\nfunction extractQuerystring(url) {\\r\\n    const queryStart = url.indexOf('?');\\r\\n    if (!queryStart) {\\r\\n        return '';\\r\\n    }\\r\\n    const fragmentStart = url.indexOf('#', queryStart);\\r\\n    return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @fileoverview SHA-1 cryptographic hash.\\r\\n * Variable names follow the notation in FIPS PUB 180-3:\\r\\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\\r\\n *\\r\\n * Usage:\\r\\n *   var sha1 = new sha1();\\r\\n *   sha1.update(bytes);\\r\\n *   var hash = sha1.digest();\\r\\n *\\r\\n * Performance:\\r\\n *   Chrome 23:   ~400 Mbit/s\\r\\n *   Firefox 16:  ~250 Mbit/s\\r\\n *\\r\\n */\\r\\n/**\\r\\n * SHA-1 cryptographic hash constructor.\\r\\n *\\r\\n * The properties declared here are discussed in the above algorithm document.\\r\\n * @constructor\\r\\n * @final\\r\\n * @struct\\r\\n */\\r\\nclass Sha1 {\\r\\n    constructor() {\\r\\n        /**\\r\\n         * Holds the previous values of accumulated variables a-e in the compress_\\r\\n         * function.\\r\\n         * @private\\r\\n         */\\r\\n        this.chain_ = [];\\r\\n        /**\\r\\n         * A buffer holding the partially computed hash result.\\r\\n         * @private\\r\\n         */\\r\\n        this.buf_ = [];\\r\\n        /**\\r\\n         * An array of 80 bytes, each a part of the message to be hashed.  Referred to\\r\\n         * as the message schedule in the docs.\\r\\n         * @private\\r\\n         */\\r\\n        this.W_ = [];\\r\\n        /**\\r\\n         * Contains data needed to pad messages less than 64 bytes.\\r\\n         * @private\\r\\n         */\\r\\n        this.pad_ = [];\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.inbuf_ = 0;\\r\\n        /**\\r\\n         * @private {number}\\r\\n         */\\r\\n        this.total_ = 0;\\r\\n        this.blockSize = 512 / 8;\\r\\n        this.pad_[0] = 128;\\r\\n        for (let i = 1; i < this.blockSize; ++i) {\\r\\n            this.pad_[i] = 0;\\r\\n        }\\r\\n        this.reset();\\r\\n    }\\r\\n    reset() {\\r\\n        this.chain_[0] = 0x67452301;\\r\\n        this.chain_[1] = 0xefcdab89;\\r\\n        this.chain_[2] = 0x98badcfe;\\r\\n        this.chain_[3] = 0x10325476;\\r\\n        this.chain_[4] = 0xc3d2e1f0;\\r\\n        this.inbuf_ = 0;\\r\\n        this.total_ = 0;\\r\\n    }\\r\\n    /**\\r\\n     * Internal compress helper function.\\r\\n     * @param buf Block to compress.\\r\\n     * @param offset Offset of the block in the buffer.\\r\\n     * @private\\r\\n     */\\r\\n    compress_(buf, offset) {\\r\\n        if (!offset) {\\r\\n            offset = 0;\\r\\n        }\\r\\n        const W = this.W_;\\r\\n        // get 16 big endian words\\r\\n        if (typeof buf === 'string') {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\\r\\n                // have a bug that turns the post-increment ++ operator into pre-increment\\r\\n                // during JIT compilation.  We have code that depends heavily on SHA-1 for\\r\\n                // correctness and which is affected by this bug, so I've removed all uses\\r\\n                // of post-increment ++ in which the result value is used.  We can revert\\r\\n                // this change once the Safari bug\\r\\n                // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\\r\\n                // most clients have been updated.\\r\\n                W[i] =\\r\\n                    (buf.charCodeAt(offset) << 24) |\\r\\n                        (buf.charCodeAt(offset + 1) << 16) |\\r\\n                        (buf.charCodeAt(offset + 2) << 8) |\\r\\n                        buf.charCodeAt(offset + 3);\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            for (let i = 0; i < 16; i++) {\\r\\n                W[i] =\\r\\n                    (buf[offset] << 24) |\\r\\n                        (buf[offset + 1] << 16) |\\r\\n                        (buf[offset + 2] << 8) |\\r\\n                        buf[offset + 3];\\r\\n                offset += 4;\\r\\n            }\\r\\n        }\\r\\n        // expand to 80 words\\r\\n        for (let i = 16; i < 80; i++) {\\r\\n            const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\\r\\n            W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\\r\\n        }\\r\\n        let a = this.chain_[0];\\r\\n        let b = this.chain_[1];\\r\\n        let c = this.chain_[2];\\r\\n        let d = this.chain_[3];\\r\\n        let e = this.chain_[4];\\r\\n        let f, k;\\r\\n        // TODO(user): Try to unroll this loop to speed up the computation.\\r\\n        for (let i = 0; i < 80; i++) {\\r\\n            if (i < 40) {\\r\\n                if (i < 20) {\\r\\n                    f = d ^ (b & (c ^ d));\\r\\n                    k = 0x5a827999;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0x6ed9eba1;\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                if (i < 60) {\\r\\n                    f = (b & c) | (d & (b | c));\\r\\n                    k = 0x8f1bbcdc;\\r\\n                }\\r\\n                else {\\r\\n                    f = b ^ c ^ d;\\r\\n                    k = 0xca62c1d6;\\r\\n                }\\r\\n            }\\r\\n            const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\\r\\n            e = d;\\r\\n            d = c;\\r\\n            c = ((b << 30) | (b >>> 2)) & 0xffffffff;\\r\\n            b = a;\\r\\n            a = t;\\r\\n        }\\r\\n        this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\\r\\n        this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\\r\\n        this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\\r\\n        this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\\r\\n        this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\\r\\n    }\\r\\n    update(bytes, length) {\\r\\n        // TODO(johnlenz): tighten the function signature and remove this check\\r\\n        if (bytes == null) {\\r\\n            return;\\r\\n        }\\r\\n        if (length === undefined) {\\r\\n            length = bytes.length;\\r\\n        }\\r\\n        const lengthMinusBlock = length - this.blockSize;\\r\\n        let n = 0;\\r\\n        // Using local instead of member variables gives ~5% speedup on Firefox 16.\\r\\n        const buf = this.buf_;\\r\\n        let inbuf = this.inbuf_;\\r\\n        // The outer while loop should execute at most twice.\\r\\n        while (n < length) {\\r\\n            // When we have no data in the block to top up, we can directly process the\\r\\n            // input buffer (assuming it contains sufficient data). This gives ~25%\\r\\n            // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\\r\\n            // the data is provided in large chunks (or in multiples of 64 bytes).\\r\\n            if (inbuf === 0) {\\r\\n                while (n <= lengthMinusBlock) {\\r\\n                    this.compress_(bytes, n);\\r\\n                    n += this.blockSize;\\r\\n                }\\r\\n            }\\r\\n            if (typeof bytes === 'string') {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes.charCodeAt(n);\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n            else {\\r\\n                while (n < length) {\\r\\n                    buf[inbuf] = bytes[n];\\r\\n                    ++inbuf;\\r\\n                    ++n;\\r\\n                    if (inbuf === this.blockSize) {\\r\\n                        this.compress_(buf);\\r\\n                        inbuf = 0;\\r\\n                        // Jump to the outer loop so we use the full-block optimization.\\r\\n                        break;\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        this.inbuf_ = inbuf;\\r\\n        this.total_ += length;\\r\\n    }\\r\\n    /** @override */\\r\\n    digest() {\\r\\n        const digest = [];\\r\\n        let totalBits = this.total_ * 8;\\r\\n        // Add pad 0x80 0x00*.\\r\\n        if (this.inbuf_ < 56) {\\r\\n            this.update(this.pad_, 56 - this.inbuf_);\\r\\n        }\\r\\n        else {\\r\\n            this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\\r\\n        }\\r\\n        // Add # bits.\\r\\n        for (let i = this.blockSize - 1; i >= 56; i--) {\\r\\n            this.buf_[i] = totalBits & 255;\\r\\n            totalBits /= 256; // Don't use bit-shifting here!\\r\\n        }\\r\\n        this.compress_(this.buf_);\\r\\n        let n = 0;\\r\\n        for (let i = 0; i < 5; i++) {\\r\\n            for (let j = 24; j >= 0; j -= 8) {\\r\\n                digest[n] = (this.chain_[i] >> j) & 255;\\r\\n                ++n;\\r\\n            }\\r\\n        }\\r\\n        return digest;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * Helper to make a Subscribe function (just like Promise helps make a\\r\\n * Thenable).\\r\\n *\\r\\n * @param executor Function which can make calls to a single Observer\\r\\n *     as a proxy.\\r\\n * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n */\\r\\nfunction createSubscribe(executor, onNoObservers) {\\r\\n    const proxy = new ObserverProxy(executor, onNoObservers);\\r\\n    return proxy.subscribe.bind(proxy);\\r\\n}\\r\\n/**\\r\\n * Implement fan-out for any number of Observers attached via a subscribe\\r\\n * function.\\r\\n */\\r\\nclass ObserverProxy {\\r\\n    /**\\r\\n     * @param executor Function which can make calls to a single Observer\\r\\n     *     as a proxy.\\r\\n     * @param onNoObservers Callback when count of Observers goes to zero.\\r\\n     */\\r\\n    constructor(executor, onNoObservers) {\\r\\n        this.observers = [];\\r\\n        this.unsubscribes = [];\\r\\n        this.observerCount = 0;\\r\\n        // Micro-task scheduling by calling task.then().\\r\\n        this.task = Promise.resolve();\\r\\n        this.finalized = false;\\r\\n        this.onNoObservers = onNoObservers;\\r\\n        // Call the executor asynchronously so subscribers that are called\\r\\n        // synchronously after the creation of the subscribe function\\r\\n        // can still receive the very first value generated in the executor.\\r\\n        this.task\\r\\n            .then(() => {\\r\\n            executor(this);\\r\\n        })\\r\\n            .catch(e => {\\r\\n            this.error(e);\\r\\n        });\\r\\n    }\\r\\n    next(value) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.next(value);\\r\\n        });\\r\\n    }\\r\\n    error(error) {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.error(error);\\r\\n        });\\r\\n        this.close(error);\\r\\n    }\\r\\n    complete() {\\r\\n        this.forEachObserver((observer) => {\\r\\n            observer.complete();\\r\\n        });\\r\\n        this.close();\\r\\n    }\\r\\n    /**\\r\\n     * Subscribe function that can be used to add an Observer to the fan-out list.\\r\\n     *\\r\\n     * - We require that no event is sent to a subscriber sychronously to their\\r\\n     *   call to subscribe().\\r\\n     */\\r\\n    subscribe(nextOrObserver, error, complete) {\\r\\n        let observer;\\r\\n        if (nextOrObserver === undefined &&\\r\\n            error === undefined &&\\r\\n            complete === undefined) {\\r\\n            throw new Error('Missing Observer.');\\r\\n        }\\r\\n        // Assemble an Observer object when passed as callback functions.\\r\\n        if (implementsAnyMethods(nextOrObserver, [\\r\\n            'next',\\r\\n            'error',\\r\\n            'complete'\\r\\n        ])) {\\r\\n            observer = nextOrObserver;\\r\\n        }\\r\\n        else {\\r\\n            observer = {\\r\\n                next: nextOrObserver,\\r\\n                error,\\r\\n                complete\\r\\n            };\\r\\n        }\\r\\n        if (observer.next === undefined) {\\r\\n            observer.next = noop;\\r\\n        }\\r\\n        if (observer.error === undefined) {\\r\\n            observer.error = noop;\\r\\n        }\\r\\n        if (observer.complete === undefined) {\\r\\n            observer.complete = noop;\\r\\n        }\\r\\n        const unsub = this.unsubscribeOne.bind(this, this.observers.length);\\r\\n        // Attempt to subscribe to a terminated Observable - we\\r\\n        // just respond to the Observer with the final error or complete\\r\\n        // event.\\r\\n        if (this.finalized) {\\r\\n            // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n            this.task.then(() => {\\r\\n                try {\\r\\n                    if (this.finalError) {\\r\\n                        observer.error(this.finalError);\\r\\n                    }\\r\\n                    else {\\r\\n                        observer.complete();\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // nothing\\r\\n                }\\r\\n                return;\\r\\n            });\\r\\n        }\\r\\n        this.observers.push(observer);\\r\\n        return unsub;\\r\\n    }\\r\\n    // Unsubscribe is synchronous - we guarantee that no events are sent to\\r\\n    // any unsubscribed Observer.\\r\\n    unsubscribeOne(i) {\\r\\n        if (this.observers === undefined || this.observers[i] === undefined) {\\r\\n            return;\\r\\n        }\\r\\n        delete this.observers[i];\\r\\n        this.observerCount -= 1;\\r\\n        if (this.observerCount === 0 && this.onNoObservers !== undefined) {\\r\\n            this.onNoObservers(this);\\r\\n        }\\r\\n    }\\r\\n    forEachObserver(fn) {\\r\\n        if (this.finalized) {\\r\\n            // Already closed by previous event....just eat the additional values.\\r\\n            return;\\r\\n        }\\r\\n        // Since sendOne calls asynchronously - there is no chance that\\r\\n        // this.observers will become undefined.\\r\\n        for (let i = 0; i < this.observers.length; i++) {\\r\\n            this.sendOne(i, fn);\\r\\n        }\\r\\n    }\\r\\n    // Call the Observer via one of it's callback function. We are careful to\\r\\n    // confirm that the observe has not been unsubscribed since this asynchronous\\r\\n    // function had been queued.\\r\\n    sendOne(i, fn) {\\r\\n        // Execute the callback asynchronously\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            if (this.observers !== undefined && this.observers[i] !== undefined) {\\r\\n                try {\\r\\n                    fn(this.observers[i]);\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // Ignore exceptions raised in Observers or missing methods of an\\r\\n                    // Observer.\\r\\n                    // Log error to console. b/31404806\\r\\n                    if (typeof console !== 'undefined' && console.error) {\\r\\n                        console.error(e);\\r\\n                    }\\r\\n                }\\r\\n            }\\r\\n        });\\r\\n    }\\r\\n    close(err) {\\r\\n        if (this.finalized) {\\r\\n            return;\\r\\n        }\\r\\n        this.finalized = true;\\r\\n        if (err !== undefined) {\\r\\n            this.finalError = err;\\r\\n        }\\r\\n        // Proxy is no longer needed - garbage collect references\\r\\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\\r\\n        this.task.then(() => {\\r\\n            this.observers = undefined;\\r\\n            this.onNoObservers = undefined;\\r\\n        });\\r\\n    }\\r\\n}\\r\\n/** Turn synchronous function into one called asynchronously. */\\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\nfunction async(fn, onError) {\\r\\n    return (...args) => {\\r\\n        Promise.resolve(true)\\r\\n            .then(() => {\\r\\n            fn(...args);\\r\\n        })\\r\\n            .catch((error) => {\\r\\n            if (onError) {\\r\\n                onError(error);\\r\\n            }\\r\\n        });\\r\\n    };\\r\\n}\\r\\n/**\\r\\n * Return true if the object passed in implements any of the named methods.\\r\\n */\\r\\nfunction implementsAnyMethods(obj, methods) {\\r\\n    if (typeof obj !== 'object' || obj === null) {\\r\\n        return false;\\r\\n    }\\r\\n    for (const method of methods) {\\r\\n        if (method in obj && typeof obj[method] === 'function') {\\r\\n            return true;\\r\\n        }\\r\\n    }\\r\\n    return false;\\r\\n}\\r\\nfunction noop() {\\r\\n    // do nothing\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Check to make sure the appropriate number of arguments are provided for a public function.\\r\\n * Throws an error if it fails.\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param minCount The minimum number of arguments to allow for the function call\\r\\n * @param maxCount The maximum number of argument to allow for the function call\\r\\n * @param argCount The actual number of arguments provided.\\r\\n */\\r\\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\\r\\n    let argError;\\r\\n    if (argCount < minCount) {\\r\\n        argError = 'at least ' + minCount;\\r\\n    }\\r\\n    else if (argCount > maxCount) {\\r\\n        argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\\r\\n    }\\r\\n    if (argError) {\\r\\n        const error = fnName +\\r\\n            ' failed: Was called with ' +\\r\\n            argCount +\\r\\n            (argCount === 1 ? ' argument.' : ' arguments.') +\\r\\n            ' Expects ' +\\r\\n            argError +\\r\\n            '.';\\r\\n        throw new Error(error);\\r\\n    }\\r\\n};\\r\\n/**\\r\\n * Generates a string to prefix an error message about failed argument validation\\r\\n *\\r\\n * @param fnName The function name\\r\\n * @param argName The name of the argument\\r\\n * @return The prefix to add to the error thrown for validation.\\r\\n */\\r\\nfunction errorPrefix(fnName, argName) {\\r\\n    return `${fnName} failed: ${argName} argument `;\\r\\n}\\r\\n/**\\r\\n * @param fnName\\r\\n * @param argumentNumber\\r\\n * @param namespace\\r\\n * @param optional\\r\\n */\\r\\nfunction validateNamespace(fnName, namespace, optional) {\\r\\n    if (optional && !namespace) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof namespace !== 'string') {\\r\\n        //TODO: I should do more validation here. We only allow certain chars in namespaces.\\r\\n        throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\\r\\n    }\\r\\n}\\r\\nfunction validateCallback(fnName, argumentName, \\r\\n// eslint-disable-next-line @typescript-eslint/ban-types\\r\\ncallback, optional) {\\r\\n    if (optional && !callback) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof callback !== 'function') {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\\r\\n    }\\r\\n}\\r\\nfunction validateContextObject(fnName, argumentName, context, optional) {\\r\\n    if (optional && !context) {\\r\\n        return;\\r\\n    }\\r\\n    if (typeof context !== 'object' || context === null) {\\r\\n        throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\\r\\n// automatically replaced '\\\\r\\\\n' with '\\\\n', and they didn't handle surrogate pairs,\\r\\n// so it's been modified.\\r\\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\\r\\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\\r\\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\\r\\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\\r\\n// pair).\\r\\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\\r\\n/**\\r\\n * @param {string} str\\r\\n * @return {Array}\\r\\n */\\r\\nconst stringToByteArray = function (str) {\\r\\n    const out = [];\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        let c = str.charCodeAt(i);\\r\\n        // Is this the lead surrogate in a surrogate pair?\\r\\n        if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            const high = c - 0xd800; // the high 10 bits.\\r\\n            i++;\\r\\n            assert(i < str.length, 'Surrogate pair missing trail surrogate.');\\r\\n            const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\\r\\n            c = 0x10000 + (high << 10) + low;\\r\\n        }\\r\\n        if (c < 128) {\\r\\n            out[p++] = c;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            out[p++] = (c >> 6) | 192;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else if (c < 65536) {\\r\\n            out[p++] = (c >> 12) | 224;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n        else {\\r\\n            out[p++] = (c >> 18) | 240;\\r\\n            out[p++] = ((c >> 12) & 63) | 128;\\r\\n            out[p++] = ((c >> 6) & 63) | 128;\\r\\n            out[p++] = (c & 63) | 128;\\r\\n        }\\r\\n    }\\r\\n    return out;\\r\\n};\\r\\n/**\\r\\n * Calculate length without actually converting; useful for doing cheaper validation.\\r\\n * @param {string} str\\r\\n * @return {number}\\r\\n */\\r\\nconst stringLength = function (str) {\\r\\n    let p = 0;\\r\\n    for (let i = 0; i < str.length; i++) {\\r\\n        const c = str.charCodeAt(i);\\r\\n        if (c < 128) {\\r\\n            p++;\\r\\n        }\\r\\n        else if (c < 2048) {\\r\\n            p += 2;\\r\\n        }\\r\\n        else if (c >= 0xd800 && c <= 0xdbff) {\\r\\n            // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\\r\\n            p += 4;\\r\\n            i++; // skip trail surrogate.\\r\\n        }\\r\\n        else {\\r\\n            p += 3;\\r\\n        }\\r\\n    }\\r\\n    return p;\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The amount of milliseconds to exponentially increase.\\r\\n */\\r\\nconst DEFAULT_INTERVAL_MILLIS = 1000;\\r\\n/**\\r\\n * The factor to backoff by.\\r\\n * Should be a number greater than 1.\\r\\n */\\r\\nconst DEFAULT_BACKOFF_FACTOR = 2;\\r\\n/**\\r\\n * The maximum milliseconds to increase to.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\\r\\n/**\\r\\n * The percentage of backoff time to randomize by.\\r\\n * See\\r\\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\\r\\n * for context.\\r\\n *\\r\\n * <p>Visible for testing\\r\\n */\\r\\nconst RANDOM_FACTOR = 0.5;\\r\\n/**\\r\\n * Based on the backoff method from\\r\\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\\r\\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\\r\\n */\\r\\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\\r\\n    // Calculates an exponentially increasing value.\\r\\n    // Deviation: calculates value from count and a constant interval, so we only need to save value\\r\\n    // and count to restore state.\\r\\n    const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\\r\\n    // A random \\\"fuzz\\\" to avoid waves of retries.\\r\\n    // Deviation: randomFactor is required.\\r\\n    const randomWait = Math.round(\\r\\n    // A fraction of the backoff value to add/subtract.\\r\\n    // Deviation: changes multiplication order to improve readability.\\r\\n    RANDOM_FACTOR *\\r\\n        currBaseValue *\\r\\n        // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\\r\\n        // if we add or subtract.\\r\\n        (Math.random() - 0.5) *\\r\\n        2);\\r\\n    // Limits backoff to max to avoid effectively permanent backoff.\\r\\n    return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provide English ordinal letters after a number\\r\\n */\\r\\nfunction ordinal(i) {\\r\\n    if (!Number.isFinite(i)) {\\r\\n        return `${i}`;\\r\\n    }\\r\\n    return i + indicator(i);\\r\\n}\\r\\nfunction indicator(i) {\\r\\n    i = Math.abs(i);\\r\\n    const cent = i % 100;\\r\\n    if (cent >= 10 && cent <= 20) {\\r\\n        return 'th';\\r\\n    }\\r\\n    const dec = i % 10;\\r\\n    if (dec === 1) {\\r\\n        return 'st';\\r\\n    }\\r\\n    if (dec === 2) {\\r\\n        return 'nd';\\r\\n    }\\r\\n    if (dec === 3) {\\r\\n        return 'rd';\\r\\n    }\\r\\n    return 'th';\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction getModularInstance(service) {\\r\\n    if (service && service._delegate) {\\r\\n        return service._delegate;\\r\\n    }\\r\\n    else {\\r\\n        return service;\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/util/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js\":\n/*!*************************************************************************!*\\\n  !*** ./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js ***!\n  \\*************************************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ErrorCode\\\": () => (/* binding */ ErrorCode),\\n/* harmony export */   \\\"Event\\\": () => (/* binding */ Event),\\n/* harmony export */   \\\"EventType\\\": () => (/* binding */ EventType),\\n/* harmony export */   \\\"FetchXmlHttpFactory\\\": () => (/* binding */ FetchXmlHttpFactory),\\n/* harmony export */   \\\"Stat\\\": () => (/* binding */ Stat),\\n/* harmony export */   \\\"WebChannel\\\": () => (/* binding */ WebChannel),\\n/* harmony export */   \\\"XhrIo\\\": () => (/* binding */ XhrIo),\\n/* harmony export */   \\\"createWebChannelTransport\\\": () => (/* binding */ createWebChannelTransport),\\n/* harmony export */   \\\"default\\\": () => (/* binding */ esm),\\n/* harmony export */   \\\"getStatEventTarget\\\": () => (/* binding */ getStatEventTarget)\\n/* harmony export */ });\\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};\\n\\nvar esm = {};\\n\\n/*\\n\\n Copyright The Closure Library Authors.\\n SPDX-License-Identifier: Apache-2.0\\n*/\\nvar k,goog=goog||{},l=commonjsGlobal||self;function aa(){}function ba(a){var b=typeof a;b=\\\"object\\\"!=b?b:a?Array.isArray(a)?\\\"array\\\":b:\\\"null\\\";return \\\"array\\\"==b||\\\"object\\\"==b&&\\\"number\\\"==typeof a.length}function p(a){var b=typeof a;return \\\"object\\\"==b&&null!=a||\\\"function\\\"==b}function da(a){return Object.prototype.hasOwnProperty.call(a,ea)&&a[ea]||(a[ea]=++fa)}var ea=\\\"closure_uid_\\\"+(1E9*Math.random()>>>0),fa=0;function ha(a,b,c){return a.call.apply(a.bind,arguments)}\\nfunction ia(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\\\"native code\\\")?q=ha:q=ia;return q.apply(null,arguments)}\\nfunction ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.Z=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Vb=function(d,e,f){for(var h=Array(arguments.length-2),n=2;n<arguments.length;n++)h[n-2]=arguments[n];return b.prototype[e].apply(d,h)};}function v(){this.s=this.s;this.o=this.o;}var ka=0,la={};v.prototype.s=!1;v.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=ka)){var a=da(this);delete la[a];}};v.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()();};const ma=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(\\\"string\\\"===typeof a)return \\\"string\\\"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(let c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return -1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c);}:function(a,b,c){const d=a.length,e=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let f=0;f<d;f++)f in e&&b.call(c,e[f],f,a);};\\nfunction oa(a){a:{var b=pa;const c=a.length,d=\\\"string\\\"===typeof a?a.split(\\\"\\\"):a;for(let e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1;}return 0>b?null:\\\"string\\\"===typeof a?a.charAt(b):a[b]}function qa(a){return Array.prototype.concat.apply([],arguments)}function ra(a){const b=a.length;if(0<b){const c=Array(b);for(let d=0;d<b;d++)c[d]=a[d];return c}return []}function sa(a){return /^[\\\\s\\\\xa0]*$/.test(a)}var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\\\\s\\\\xa0]*([\\\\s\\\\S]*?)[\\\\s\\\\xa0]*$/.exec(a)[1]};function w(a,b){return -1!=a.indexOf(b)}function ua(a,b){return a<b?-1:a>b?1:0}var x;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){x=wa;break a}}x=\\\"\\\";}function xa(a,b,c){for(const d in a)b.call(c,a[d],d,a);}function ya(a){const b={};for(const c in a)b[c]=a[c];return b}var za=\\\"constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf\\\".split(\\\" \\\");function Aa(a,b){let c,d;for(let e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(let f=0;f<za.length;f++)c=za[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c]);}}function Ca(a){Ca[\\\" \\\"](a);return a}Ca[\\\" \\\"]=aa;function Fa(a){var b=Ga;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}var Ha=w(x,\\\"Opera\\\"),y=w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"),Ia=w(x,\\\"Edge\\\"),Ja=Ia||y,Ka=w(x,\\\"Gecko\\\")&&!(w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\"))&&!(w(x,\\\"Trident\\\")||w(x,\\\"MSIE\\\"))&&!w(x,\\\"Edge\\\"),La=w(x.toLowerCase(),\\\"webkit\\\")&&!w(x,\\\"Edge\\\");function Ma(){var a=l.document;return a?a.documentMode:void 0}var Na;\\na:{var Oa=\\\"\\\",Pa=function(){var a=x;if(Ka)return /rv:([^\\\\);]+)(\\\\)|;)/.exec(a);if(Ia)return /Edge\\\\/([\\\\d\\\\.]+)/.exec(a);if(y)return /\\\\b(?:MSIE|rv)[: ]([^\\\\);]+)(\\\\)|;)/.exec(a);if(La)return /WebKit\\\\/(\\\\S+)/.exec(a);if(Ha)return /(?:Version)[ \\\\/]?(\\\\S+)/.exec(a)}();Pa&&(Oa=Pa?Pa[1]:\\\"\\\");if(y){var Qa=Ma();if(null!=Qa&&Qa>parseFloat(Oa)){Na=String(Qa);break a}}Na=Oa;}var Ga={};\\nfunction Ra(){return Fa(function(){let a=0;const b=ta(String(Na)).split(\\\".\\\"),c=ta(\\\"9\\\").split(\\\".\\\"),d=Math.max(b.length,c.length);for(let h=0;0==a&&h<d;h++){var e=b[h]||\\\"\\\",f=c[h]||\\\"\\\";do{e=/(\\\\d*)(\\\\D*)(.*)/.exec(e)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];f=/(\\\\d*)(\\\\D*)(.*)/.exec(f)||[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"];if(0==e[0].length&&0==f[0].length)break;a=ua(0==e[1].length?0:parseInt(e[1],10),0==f[1].length?0:parseInt(f[1],10))||ua(0==e[2].length,0==f[2].length)||ua(e[2],f[2]);e=e[3];f=f[3];}while(0==a)}return 0<=a})}var Sa;\\nif(l.document&&y){var Ta=Ma();Sa=Ta?Ta:parseInt(Na,10)||void 0;}else Sa=void 0;var Ua=Sa;var Va=function(){if(!l.addEventListener||!Object.defineProperty)return !1;var a=!1,b=Object.defineProperty({},\\\"passive\\\",{get:function(){a=!0;}});try{l.addEventListener(\\\"test\\\",aa,b),l.removeEventListener(\\\"test\\\",aa,b);}catch(c){}return a}();function z(a,b){this.type=a;this.g=this.target=b;this.defaultPrevented=!1;}z.prototype.h=function(){this.defaultPrevented=!0;};function A(a,b){z.call(this,a?a.type:\\\"\\\");this.relatedTarget=this.g=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key=\\\"\\\";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType=\\\"\\\";this.i=null;if(a){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.g=b;if(b=a.relatedTarget){if(Ka){a:{try{Ca(b.nodeName);var e=!0;break a}catch(f){}e=\\n!1;}e||(b=null);}}else \\\"mouseover\\\"==c?b=a.fromElement:\\\"mouseout\\\"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||\\\"\\\";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=\\na.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=\\\"string\\\"===typeof a.pointerType?a.pointerType:Wa[a.pointerType]||\\\"\\\";this.state=a.state;this.i=a;a.defaultPrevented&&A.Z.h.call(this);}}t(A,z);var Wa={2:\\\"touch\\\",3:\\\"pen\\\",4:\\\"mouse\\\"};A.prototype.h=function(){A.Z.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1;};var B=\\\"closure_listenable_\\\"+(1E6*Math.random()|0);var Xa=0;function Ya(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.ia=e;this.key=++Xa;this.ca=this.fa=!1;}function Za(a){a.ca=!0;a.listener=null;a.proxy=null;a.src=null;a.ia=null;}function $a(a){this.src=a;this.g={};this.h=0;}$a.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.h++);var h=ab(a,b,d,e);-1<h?(b=a[h],c||(b.fa=!1)):(b=new Ya(b,this.src,f,!!d,e),b.fa=c,a.push(b));return b};function bb(a,b){var c=b.type;if(c in a.g){var d=a.g[c],e=ma(d,b),f;(f=0<=e)&&Array.prototype.splice.call(d,e,1);f&&(Za(b),0==a.g[c].length&&(delete a.g[c],a.h--));}}\\nfunction ab(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ca&&f.listener==b&&f.capture==!!c&&f.ia==d)return e}return -1}var cb=\\\"closure_lm_\\\"+(1E6*Math.random()|0),db={};function fb(a,b,c,d,e){if(d&&d.once)return gb(a,b,c,d,e);if(Array.isArray(b)){for(var f=0;f<b.length;f++)fb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.N(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!1,d,e)}\\nfunction ib(a,b,c,d,e,f){if(!b)throw Error(\\\"Invalid event type\\\");var h=p(e)?!!e.capture:!!e,n=jb(a);n||(a[cb]=n=new $a(a));c=n.add(b,c,d,h,f);if(c.proxy)return c;d=kb();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)Va||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(lb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error(\\\"addEventListener and attachEvent are unavailable.\\\");return c}\\nfunction kb(){function a(c){return b.call(a.src,a.listener,c)}var b=mb;return a}function gb(a,b,c,d,e){if(Array.isArray(b)){for(var f=0;f<b.length;f++)gb(a,b[f],c,d,e);return null}c=hb(c);return a&&a[B]?a.O(b,c,p(d)?!!d.capture:!!d,e):ib(a,b,c,!0,d,e)}\\nfunction nb(a,b,c,d,e){if(Array.isArray(b))for(var f=0;f<b.length;f++)nb(a,b[f],c,d,e);else (d=p(d)?!!d.capture:!!d,c=hb(c),a&&a[B])?(a=a.i,b=String(b).toString(),b in a.g&&(f=a.g[b],c=ab(f,c,d,e),-1<c&&(Za(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.g[b],a.h--)))):a&&(a=jb(a))&&(b=a.g[b.toString()],a=-1,b&&(a=ab(b,c,d,e)),(c=-1<a?b[a]:null)&&ob(c));}\\nfunction ob(a){if(\\\"number\\\"!==typeof a&&a&&!a.ca){var b=a.src;if(b&&b[B])bb(b.i,a);else {var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(lb(c),d):b.addListener&&b.removeListener&&b.removeListener(d);(c=jb(b))?(bb(c,a),0==c.h&&(c.src=null,b[cb]=null)):Za(a);}}}function lb(a){return a in db?db[a]:db[a]=\\\"on\\\"+a}function mb(a,b){if(a.ca)a=!0;else {b=new A(b,this);var c=a.listener,d=a.ia||a.src;a.fa&&ob(a);a=c.call(d,b);}return a}\\nfunction jb(a){a=a[cb];return a instanceof $a?a:null}var pb=\\\"__closure_events_fn_\\\"+(1E9*Math.random()>>>0);function hb(a){if(\\\"function\\\"===typeof a)return a;a[pb]||(a[pb]=function(b){return a.handleEvent(b)});return a[pb]}function C(){v.call(this);this.i=new $a(this);this.P=this;this.I=null;}t(C,v);C.prototype[B]=!0;C.prototype.removeEventListener=function(a,b,c,d){nb(this,a,b,c,d);};\\nfunction D(a,b){var c,d=a.I;if(d)for(c=[];d;d=d.I)c.push(d);a=a.P;d=b.type||b;if(\\\"string\\\"===typeof b)b=new z(b,a);else if(b instanceof z)b.target=b.target||a;else {var e=b;b=new z(d,a);Aa(b,e);}e=!0;if(c)for(var f=c.length-1;0<=f;f--){var h=b.g=c[f];e=qb(h,d,!0,b)&&e;}h=b.g=a;e=qb(h,d,!0,b)&&e;e=qb(h,d,!1,b)&&e;if(c)for(f=0;f<c.length;f++)h=b.g=c[f],e=qb(h,d,!1,b)&&e;}\\nC.prototype.M=function(){C.Z.M.call(this);if(this.i){var a=this.i,c;for(c in a.g){for(var d=a.g[c],e=0;e<d.length;e++)Za(d[e]);delete a.g[c];a.h--;}}this.I=null;};C.prototype.N=function(a,b,c,d){return this.i.add(String(a),b,!1,c,d)};C.prototype.O=function(a,b,c,d){return this.i.add(String(a),b,!0,c,d)};\\nfunction qb(a,b,c,d){b=a.i.g[String(b)];if(!b)return !0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ca&&h.capture==c){var n=h.listener,u=h.ia||h.src;h.fa&&bb(a.i,h);e=!1!==n.call(u,d)&&e;}}return e&&!d.defaultPrevented}var rb=l.JSON.stringify;function sb(){var a=tb;let b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}class ub{constructor(){this.h=this.g=null;}add(a,b){const c=vb.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c;}}var vb=new class{constructor(a,b){this.i=a;this.j=b;this.h=0;this.g=null;}get(){let a;0<this.h?(this.h--,a=this.g,this.g=a.next,a.next=null):a=this.i();return a}}(()=>new wb,a=>a.reset());\\nclass wb{constructor(){this.next=this.g=this.h=null;}set(a,b){this.h=a;this.g=b;this.next=null;}reset(){this.next=this.g=this.h=null;}}function yb(a){l.setTimeout(()=>{throw a;},0);}function zb(a,b){Ab||Bb();Cb||(Ab(),Cb=!0);tb.add(a,b);}var Ab;function Bb(){var a=l.Promise.resolve(void 0);Ab=function(){a.then(Db);};}var Cb=!1,tb=new ub;function Db(){for(var a;a=sb();){try{a.h.call(a.g);}catch(c){yb(c);}var b=vb;b.j(a);100>b.h&&(b.h++,a.next=b.g,b.g=a);}Cb=!1;}function Eb(a,b){C.call(this);this.h=a||1;this.g=b||l;this.j=q(this.kb,this);this.l=Date.now();}t(Eb,C);k=Eb.prototype;k.da=!1;k.S=null;k.kb=function(){if(this.da){var a=Date.now()-this.l;0<a&&a<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-a):(this.S&&(this.g.clearTimeout(this.S),this.S=null),D(this,\\\"tick\\\"),this.da&&(Fb(this),this.start()));}};k.start=function(){this.da=!0;this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now());};\\nfunction Fb(a){a.da=!1;a.S&&(a.g.clearTimeout(a.S),a.S=null);}k.M=function(){Eb.Z.M.call(this);Fb(this);delete this.g;};function Gb(a,b,c){if(\\\"function\\\"===typeof a)c&&(a=q(a,c));else if(a&&\\\"function\\\"==typeof a.handleEvent)a=q(a.handleEvent,a);else throw Error(\\\"Invalid listener argument\\\");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)}function Hb(a){a.g=Gb(()=>{a.g=null;a.i&&(a.i=!1,Hb(a));},a.j);const b=a.h;a.h=null;a.m.apply(null,b);}class Ib extends v{constructor(a,b){super();this.m=a;this.j=b;this.h=null;this.i=!1;this.g=null;}l(a){this.h=arguments;this.g?this.i=!0:Hb(this);}M(){super.M();this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null);}}function E(a){v.call(this);this.h=a;this.g={};}t(E,v);var Jb=[];function Kb(a,b,c,d){Array.isArray(c)||(c&&(Jb[0]=c.toString()),c=Jb);for(var e=0;e<c.length;e++){var f=fb(b,c[e],d||a.handleEvent,!1,a.h||a);if(!f)break;a.g[f.key]=f;}}function Lb(a){xa(a.g,function(b,c){this.g.hasOwnProperty(c)&&ob(b);},a);a.g={};}E.prototype.M=function(){E.Z.M.call(this);Lb(this);};E.prototype.handleEvent=function(){throw Error(\\\"EventHandler.handleEvent not implemented\\\");};function Mb(){this.g=!0;}Mb.prototype.Aa=function(){this.g=!1;};function Nb(a,b,c,d,e,f){a.info(function(){if(a.g)if(f){var h=\\\"\\\";for(var n=f.split(\\\"&\\\"),u=0;u<n.length;u++){var m=n[u].split(\\\"=\\\");if(1<m.length){var r=m[0];m=m[1];var G=r.split(\\\"_\\\");h=2<=G.length&&\\\"type\\\"==G[1]?h+(r+\\\"=\\\"+m+\\\"&\\\"):h+(r+\\\"=redacted&\\\");}}}else h=null;else h=f;return \\\"XMLHTTP REQ (\\\"+d+\\\") [attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+h});}\\nfunction Ob(a,b,c,d,e,f,h){a.info(function(){return \\\"XMLHTTP RESP (\\\"+d+\\\") [ attempt \\\"+e+\\\"]: \\\"+b+\\\"\\\\n\\\"+c+\\\"\\\\n\\\"+f+\\\" \\\"+h});}function F(a,b,c,d){a.info(function(){return \\\"XMLHTTP TEXT (\\\"+b+\\\"): \\\"+Pb(a,c)+(d?\\\" \\\"+d:\\\"\\\")});}function Qb(a,b){a.info(function(){return \\\"TIMEOUT: \\\"+b});}Mb.prototype.info=function(){};\\nfunction Pb(a,b){if(!a.g)return b;if(!b)return null;try{var c=JSON.parse(b);if(c)for(a=0;a<c.length;a++)if(Array.isArray(c[a])){var d=c[a];if(!(2>d.length)){var e=d[1];if(Array.isArray(e)&&!(1>e.length)){var f=e[0];if(\\\"noop\\\"!=f&&\\\"stop\\\"!=f&&\\\"close\\\"!=f)for(var h=1;h<e.length;h++)e[h]=\\\"\\\";}}}return rb(c)}catch(n){return b}}var H={},Rb=null;function Sb(){return Rb=Rb||new C}H.Ma=\\\"serverreachability\\\";function Tb(a){z.call(this,H.Ma,a);}t(Tb,z);function I(a){const b=Sb();D(b,new Tb(b,a));}H.STAT_EVENT=\\\"statevent\\\";function Ub(a,b){z.call(this,H.STAT_EVENT,a);this.stat=b;}t(Ub,z);function J(a){const b=Sb();D(b,new Ub(b,a));}H.Na=\\\"timingevent\\\";function Vb(a,b){z.call(this,H.Na,a);this.size=b;}t(Vb,z);\\nfunction K(a,b){if(\\\"function\\\"!==typeof a)throw Error(\\\"Fn must not be null and must be a function\\\");return l.setTimeout(function(){a();},b)}var Wb={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9};var Xb={qb:\\\"complete\\\",Mb:\\\"success\\\",Ka:\\\"error\\\",Ja:\\\"abort\\\",Eb:\\\"ready\\\",Fb:\\\"readystatechange\\\",TIMEOUT:\\\"timeout\\\",Ab:\\\"incrementaldata\\\",Db:\\\"progress\\\",tb:\\\"downloadprogress\\\",Ub:\\\"uploadprogress\\\"};function Yb(){}Yb.prototype.h=null;function Zb(a){return a.h||(a.h=a.i())}function $b(){}var L={OPEN:\\\"a\\\",pb:\\\"b\\\",Ka:\\\"c\\\",Bb:\\\"d\\\"};function ac(){z.call(this,\\\"d\\\");}t(ac,z);function bc(){z.call(this,\\\"c\\\");}t(bc,z);var cc;function dc(){}t(dc,Yb);dc.prototype.g=function(){return new XMLHttpRequest};dc.prototype.i=function(){return {}};cc=new dc;function M(a,b,c,d){this.l=a;this.j=b;this.m=c;this.X=d||1;this.V=new E(this);this.P=ec;a=Ja?125:void 0;this.W=new Eb(a);this.H=null;this.i=!1;this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null;this.D=[];this.g=null;this.C=0;this.o=this.u=null;this.N=-1;this.I=!1;this.O=0;this.L=null;this.aa=this.J=this.$=this.U=!1;this.h=new fc;}function fc(){this.i=null;this.g=\\\"\\\";this.h=!1;}var ec=45E3,gc={},hc={};k=M.prototype;k.setTimeout=function(a){this.P=a;};\\nfunction ic(a,b,c){a.K=1;a.v=jc(N(b));a.s=c;a.U=!0;kc(a,null);}function kc(a,b){a.F=Date.now();lc(a);a.A=N(a.v);var c=a.A,d=a.X;Array.isArray(d)||(d=[String(d)]);mc(c.h,\\\"t\\\",d);a.C=0;c=a.l.H;a.h=new fc;a.g=nc(a.l,c?b:null,!a.s);0<a.O&&(a.L=new Ib(q(a.Ia,a,a.g),a.O));Kb(a.V,a.g,\\\"readystatechange\\\",a.gb);b=a.H?ya(a.H):{};a.s?(a.u||(a.u=\\\"POST\\\"),b[\\\"Content-Type\\\"]=\\\"application/x-www-form-urlencoded\\\",a.g.ea(a.A,a.u,a.s,b)):(a.u=\\\"GET\\\",a.g.ea(a.A,a.u,null,b));I(1);Nb(a.j,a.u,a.A,a.m,a.X,a.s);}\\nk.gb=function(a){a=a.target;const b=this.L;b&&3==O(a)?b.l():this.Ia(a);};\\nk.Ia=function(a){try{if(a==this.g)a:{const r=O(this.g);var b=this.g.Da();const G=this.g.ba();if(!(3>r)&&(3!=r||Ja||this.g&&(this.h.h||this.g.ga()||oc(this.g)))){this.I||4!=r||7==b||(8==b||0>=G?I(3):I(2));pc(this);var c=this.g.ba();this.N=c;b:if(qc(this)){var d=oc(this.g);a=\\\"\\\";var e=d.length,f=4==O(this.g);if(!this.h.i){if(\\\"undefined\\\"===typeof TextDecoder){P(this);rc(this);var h=\\\"\\\";break b}this.h.i=new l.TextDecoder;}for(b=0;b<e;b++)this.h.h=!0,a+=this.h.i.decode(d[b],{stream:f&&b==e-1});d.splice(0,\\ne);this.h.g+=a;this.C=0;h=this.h.g;}else h=this.g.ga();this.i=200==c;Ob(this.j,this.u,this.A,this.m,this.X,r,c);if(this.i){if(this.$&&!this.J){b:{if(this.g){var n,u=this.g;if((n=u.g?u.g.getResponseHeader(\\\"X-HTTP-Initial-Response\\\"):null)&&!sa(n)){var m=n;break b}}m=null;}if(c=m)F(this.j,this.m,c,\\\"Initial handshake response via X-HTTP-Initial-Response\\\"),this.J=!0,sc(this,c);else {this.i=!1;this.o=3;J(12);P(this);rc(this);break a}}this.U?(tc(this,r,h),Ja&&this.i&&3==r&&(Kb(this.V,this.W,\\\"tick\\\",this.fb),\\nthis.W.start())):(F(this.j,this.m,h,null),sc(this,h));4==r&&P(this);this.i&&!this.I&&(4==r?uc(this.l,this):(this.i=!1,lc(this)));}else 400==c&&0<h.indexOf(\\\"Unknown SID\\\")?(this.o=3,J(12)):(this.o=0,J(13)),P(this),rc(this);}}}catch(r){}finally{}};function qc(a){return a.g?\\\"GET\\\"==a.u&&2!=a.K&&a.l.Ba:!1}\\nfunction tc(a,b,c){let d=!0,e;for(;!a.I&&a.C<c.length;)if(e=vc(a,c),e==hc){4==b&&(a.o=4,J(14),d=!1);F(a.j,a.m,null,\\\"[Incomplete Response]\\\");break}else if(e==gc){a.o=4;J(15);F(a.j,a.m,c,\\\"[Invalid Chunk]\\\");d=!1;break}else F(a.j,a.m,e,null),sc(a,e);qc(a)&&e!=hc&&e!=gc&&(a.h.g=\\\"\\\",a.C=0);4!=b||0!=c.length||a.h.h||(a.o=1,J(16),d=!1);a.i=a.i&&d;d?0<c.length&&!a.aa&&(a.aa=!0,b=a.l,b.g==a&&b.$&&!b.L&&(b.h.info(\\\"Great, no buffering proxy detected. Bytes received: \\\"+c.length),wc(b),b.L=!0,J(11))):(F(a.j,a.m,\\nc,\\\"[Invalid Chunked Response]\\\"),P(a),rc(a));}k.fb=function(){if(this.g){var a=O(this.g),b=this.g.ga();this.C<b.length&&(pc(this),tc(this,a,b),this.i&&4!=a&&lc(this));}};function vc(a,b){var c=a.C,d=b.indexOf(\\\"\\\\n\\\",c);if(-1==d)return hc;c=Number(b.substring(c,d));if(isNaN(c))return gc;d+=1;if(d+c>b.length)return hc;b=b.substr(d,c);a.C=d+c;return b}k.cancel=function(){this.I=!0;P(this);};function lc(a){a.Y=Date.now()+a.P;xc(a,a.P);}\\nfunction xc(a,b){if(null!=a.B)throw Error(\\\"WatchDog timer not null\\\");a.B=K(q(a.eb,a),b);}function pc(a){a.B&&(l.clearTimeout(a.B),a.B=null);}k.eb=function(){this.B=null;const a=Date.now();0<=a-this.Y?(Qb(this.j,this.A),2!=this.K&&(I(3),J(17)),P(this),this.o=2,rc(this)):xc(this,this.Y-a);};function rc(a){0==a.l.G||a.I||uc(a.l,a);}function P(a){pc(a);var b=a.L;b&&\\\"function\\\"==typeof b.na&&b.na();a.L=null;Fb(a.W);Lb(a.V);a.g&&(b=a.g,a.g=null,b.abort(),b.na());}\\nfunction sc(a,b){try{var c=a.l;if(0!=c.G&&(c.g==a||yc(c.i,a)))if(c.I=a.N,!a.J&&yc(c.i,a)&&3==c.G){try{var d=c.Ca.g.parse(b);}catch(m){d=null;}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.u){if(c.g)if(c.g.F+3E3<a.F)zc(c),Ac(c);else break a;Bc(c);J(18);}}else c.ta=e[1],0<c.ta-c.U&&37500>e[2]&&c.N&&0==c.A&&!c.v&&(c.v=K(q(c.ab,c),6E3));if(1>=Cc(c.i)&&c.ka){try{c.ka();}catch(m){}c.ka=void 0;}}else Q(c,11);}else if((a.J||c.g==a)&&zc(c),!sa(b))for(e=c.Ca.g.parse(b),b=0;b<e.length;b++){let m=e[b];\\nc.U=m[0];m=m[1];if(2==c.G)if(\\\"c\\\"==m[0]){c.J=m[1];c.la=m[2];const r=m[3];null!=r&&(c.ma=r,c.h.info(\\\"VER=\\\"+c.ma));const G=m[4];null!=G&&(c.za=G,c.h.info(\\\"SVER=\\\"+c.za));const Da=m[5];null!=Da&&\\\"number\\\"===typeof Da&&0<Da&&(d=1.5*Da,c.K=d,c.h.info(\\\"backChannelRequestTimeoutMs_=\\\"+d));d=c;const ca=a.g;if(ca){const Ea=ca.g?ca.g.getResponseHeader(\\\"X-Client-Wire-Protocol\\\"):null;if(Ea){var f=d.i;!f.g&&(w(Ea,\\\"spdy\\\")||w(Ea,\\\"quic\\\")||w(Ea,\\\"h2\\\"))&&(f.j=f.l,f.g=new Set,f.h&&(Dc(f,f.h),f.h=null));}if(d.D){const xb=\\nca.g?ca.g.getResponseHeader(\\\"X-HTTP-Session-Id\\\"):null;xb&&(d.sa=xb,R(d.F,d.D,xb));}}c.G=3;c.j&&c.j.xa();c.$&&(c.O=Date.now()-a.F,c.h.info(\\\"Handshake RTT: \\\"+c.O+\\\"ms\\\"));d=c;var h=a;d.oa=Ec(d,d.H?d.la:null,d.W);if(h.J){Fc(d.i,h);var n=h,u=d.K;u&&n.setTimeout(u);n.B&&(pc(n),lc(n));d.g=h;}else Gc(d);0<c.l.length&&Hc(c);}else \\\"stop\\\"!=m[0]&&\\\"close\\\"!=m[0]||Q(c,7);else 3==c.G&&(\\\"stop\\\"==m[0]||\\\"close\\\"==m[0]?\\\"stop\\\"==m[0]?Q(c,7):Ic(c):\\\"noop\\\"!=m[0]&&c.j&&c.j.wa(m),c.A=0);}I(4);}catch(m){}}function Jc(a){if(a.R&&\\\"function\\\"==typeof a.R)return a.R();if(\\\"string\\\"===typeof a)return a.split(\\\"\\\");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b}\\nfunction Kc(a,b){if(a.forEach&&\\\"function\\\"==typeof a.forEach)a.forEach(b,void 0);else if(ba(a)||\\\"string\\\"===typeof a)na(a,b,void 0);else {if(a.T&&\\\"function\\\"==typeof a.T)var c=a.T();else if(a.R&&\\\"function\\\"==typeof a.R)c=void 0;else if(ba(a)||\\\"string\\\"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e);}else for(e in c=[],d=0,a)c[d++]=e;d=Jc(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a);}}function S(a,b){this.h={};this.g=[];this.i=0;var c=arguments.length;if(1<c){if(c%2)throw Error(\\\"Uneven number of arguments\\\");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1]);}else if(a)if(a instanceof S)for(c=a.T(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d]);}k=S.prototype;k.R=function(){Lc(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.h[this.g[b]]);return a};k.T=function(){Lc(this);return this.g.concat()};\\nfunction Lc(a){if(a.i!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];T(a.h,d)&&(a.g[c++]=d);b++;}a.g.length=c;}if(a.i!=a.g.length){var e={};for(c=b=0;b<a.g.length;)d=a.g[b],T(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c;}}k.get=function(a,b){return T(this.h,a)?this.h[a]:b};k.set=function(a,b){T(this.h,a)||(this.i++,this.g.push(a));this.h[a]=b;};k.forEach=function(a,b){for(var c=this.T(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this);}};\\nfunction T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var Mc=/^(?:([^:/?#.]+):)?(?:\\\\/\\\\/(?:([^\\\\\\\\/?#]*)@)?([^\\\\\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\\\\\/?#]|$))?([^?#]+)?(?:\\\\?([^#]*))?(?:#([\\\\s\\\\S]*))?$/;function Nc(a,b){if(a){a=a.split(\\\"&\\\");for(var c=0;c<a.length;c++){var d=a[c].indexOf(\\\"=\\\"),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1);}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\\\\+/g,\\\" \\\")):\\\"\\\");}}}function U(a,b){this.i=this.s=this.j=\\\"\\\";this.m=null;this.o=this.l=\\\"\\\";this.g=!1;if(a instanceof U){this.g=void 0!==b?b:a.g;Oc(this,a.j);this.s=a.s;Pc(this,a.i);Qc(this,a.m);this.l=a.l;b=a.h;var c=new Rc;c.i=b.i;b.g&&(c.g=new S(b.g),c.h=b.h);Sc(this,c);this.o=a.o;}else a&&(c=String(a).match(Mc))?(this.g=!!b,Oc(this,c[1]||\\\"\\\",!0),this.s=Tc(c[2]||\\\"\\\"),Pc(this,c[3]||\\\"\\\",!0),Qc(this,c[4]),this.l=Tc(c[5]||\\\"\\\",!0),Sc(this,c[6]||\\\"\\\",!0),this.o=Tc(c[7]||\\\"\\\")):(this.g=!!b,this.h=new Rc(null,this.g));}\\nU.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Uc(b,Vc,!0),\\\":\\\");var c=this.i;if(c||\\\"file\\\"==b)a.push(\\\"//\\\"),(b=this.s)&&a.push(Uc(b,Vc,!0),\\\"@\\\"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),c=this.m,null!=c&&a.push(\\\":\\\",String(c));if(c=this.l)this.i&&\\\"/\\\"!=c.charAt(0)&&a.push(\\\"/\\\"),a.push(Uc(c,\\\"/\\\"==c.charAt(0)?Wc:Xc,!0));(c=this.h.toString())&&a.push(\\\"?\\\",c);(c=this.o)&&a.push(\\\"#\\\",Uc(c,Yc));return a.join(\\\"\\\")};function N(a){return new U(a)}\\nfunction Oc(a,b,c){a.j=c?Tc(b,!0):b;a.j&&(a.j=a.j.replace(/:$/,\\\"\\\"));}function Pc(a,b,c){a.i=c?Tc(b,!0):b;}function Qc(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\\\"Bad port number \\\"+b);a.m=b;}else a.m=null;}function Sc(a,b,c){b instanceof Rc?(a.h=b,Zc(a.h,a.g)):(c||(b=Uc(b,$c)),a.h=new Rc(b,a.g));}function R(a,b,c){a.h.set(b,c);}function jc(a){R(a,\\\"zx\\\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36));return a}\\nfunction ad(a){return a instanceof U?N(a):new U(a,void 0)}function bd(a,b,c,d){var e=new U(null,void 0);a&&Oc(e,a);b&&Pc(e,b);c&&Qc(e,c);d&&(e.l=d);return e}function Tc(a,b){return a?b?decodeURI(a.replace(/%25/g,\\\"%2525\\\")):decodeURIComponent(a):\\\"\\\"}function Uc(a,b,c){return \\\"string\\\"===typeof a?(a=encodeURI(a).replace(b,cd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\\\"%$1\\\")),a):null}function cd(a){a=a.charCodeAt(0);return \\\"%\\\"+(a>>4&15).toString(16)+(a&15).toString(16)}\\nvar Vc=/[#\\\\/\\\\?@]/g,Xc=/[#\\\\?:]/g,Wc=/[#\\\\?]/g,$c=/[#\\\\?@]/g,Yc=/#/g;function Rc(a,b){this.h=this.g=null;this.i=a||null;this.j=!!b;}function V(a){a.g||(a.g=new S,a.h=0,a.i&&Nc(a.i,function(b,c){a.add(decodeURIComponent(b.replace(/\\\\+/g,\\\" \\\")),c);}));}k=Rc.prototype;k.add=function(a,b){V(this);this.i=null;a=W(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.h+=1;return this};\\nfunction dd(a,b){V(a);b=W(a,b);T(a.g.h,b)&&(a.i=null,a.h-=a.g.get(b).length,a=a.g,T(a.h,b)&&(delete a.h[b],a.i--,a.g.length>2*a.i&&Lc(a)));}function ed(a,b){V(a);b=W(a,b);return T(a.g.h,b)}k.forEach=function(a,b){V(this);this.g.forEach(function(c,d){na(c,function(e){a.call(b,e,d,this);},this);},this);};k.T=function(){V(this);for(var a=this.g.R(),b=this.g.T(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};\\nk.R=function(a){V(this);var b=[];if(\\\"string\\\"===typeof a)ed(this,a)&&(b=qa(b,this.g.get(W(this,a))));else {a=this.g.R();for(var c=0;c<a.length;c++)b=qa(b,a[c]);}return b};k.set=function(a,b){V(this);this.i=null;a=W(this,a);ed(this,a)&&(this.h-=this.g.get(a).length);this.g.set(a,[b]);this.h+=1;return this};k.get=function(a,b){if(!a)return b;a=this.R(a);return 0<a.length?String(a[0]):b};function mc(a,b,c){dd(a,b);0<c.length&&(a.i=null,a.g.set(W(a,b),ra(c)),a.h+=c.length);}\\nk.toString=function(){if(this.i)return this.i;if(!this.g)return \\\"\\\";for(var a=[],b=this.g.T(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.R(d);for(var f=0;f<d.length;f++){var h=e;\\\"\\\"!==d[f]&&(h+=\\\"=\\\"+encodeURIComponent(String(d[f])));a.push(h);}}return this.i=a.join(\\\"&\\\")};function W(a,b){b=String(b);a.j&&(b=b.toLowerCase());return b}function Zc(a,b){b&&!a.j&&(V(a),a.i=null,a.g.forEach(function(c,d){var e=d.toLowerCase();d!=e&&(dd(this,d),mc(this,e,c));},a));a.j=b;}var fd=class{constructor(a,b){this.h=a;this.g=b;}};function gd(a){this.l=a||hd;l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType(\\\"navigation\\\"),a=0<a.length&&(\\\"hq\\\"==a[0].nextHopProtocol||\\\"h2\\\"==a[0].nextHopProtocol)):a=!!(l.g&&l.g.Ea&&l.g.Ea()&&l.g.Ea().Zb);this.j=a?this.l:1;this.g=null;1<this.j&&(this.g=new Set);this.h=null;this.i=[];}var hd=10;function id(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Cc(a){return a.h?1:a.g?a.g.size:0}function yc(a,b){return a.h?a.h==b:a.g?a.g.has(b):!1}function Dc(a,b){a.g?a.g.add(b):a.h=b;}\\nfunction Fc(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b);}gd.prototype.cancel=function(){this.i=jd(this);if(this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear();}};function jd(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const c of a.g.values())b=b.concat(c.D);return b}return ra(a.i)}function kd(){}kd.prototype.stringify=function(a){return l.JSON.stringify(a,void 0)};kd.prototype.parse=function(a){return l.JSON.parse(a,void 0)};function ld(){this.g=new kd;}function md(a,b,c){const d=c||\\\"\\\";try{Kc(a,function(e,f){let h=e;p(e)&&(h=rb(e));b.push(d+f+\\\"=\\\"+encodeURIComponent(h));});}catch(e){throw b.push(d+\\\"type=\\\"+encodeURIComponent(\\\"_badmap\\\")),e;}}function nd(a,b){const c=new Mb;if(l.Image){const d=new Image;d.onload=ja(od,c,d,\\\"TestLoadImage: loaded\\\",!0,b);d.onerror=ja(od,c,d,\\\"TestLoadImage: error\\\",!1,b);d.onabort=ja(od,c,d,\\\"TestLoadImage: abort\\\",!1,b);d.ontimeout=ja(od,c,d,\\\"TestLoadImage: timeout\\\",!1,b);l.setTimeout(function(){if(d.ontimeout)d.ontimeout();},1E4);d.src=a;}else b(!1);}function od(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d);}catch(f){}}function pd(a){this.l=a.$b||null;this.j=a.ib||!1;}t(pd,Yb);pd.prototype.g=function(){return new qd(this.l,this.j)};pd.prototype.i=function(a){return function(){return a}}({});function qd(a,b){C.call(this);this.D=a;this.u=b;this.m=void 0;this.readyState=rd;this.status=0;this.responseType=this.responseText=this.response=this.statusText=\\\"\\\";this.onreadystatechange=null;this.v=new Headers;this.h=null;this.C=\\\"GET\\\";this.B=\\\"\\\";this.g=!1;this.A=this.j=this.l=null;}t(qd,C);var rd=0;k=qd.prototype;\\nk.open=function(a,b){if(this.readyState!=rd)throw this.abort(),Error(\\\"Error reopening a connection\\\");this.C=a;this.B=b;this.readyState=1;sd(this);};k.send=function(a){if(1!=this.readyState)throw this.abort(),Error(\\\"need to call open() first. \\\");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a);(this.D||l).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this));};\\nk.abort=function(){this.response=this.responseText=\\\"\\\";this.v=new Headers;this.status=0;this.j&&this.j.cancel(\\\"Request was aborted.\\\");1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this));this.readyState=rd;};\\nk.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,sd(this)),this.g&&(this.readyState=3,sd(this),this.g)))if(\\\"arraybuffer\\\"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(\\\"undefined\\\"!==typeof l.ReadableStream&&\\\"body\\\"in a){this.j=a.body.getReader();if(this.u){if(this.responseType)throw Error('responseType must be empty for \\\"streamBinaryChunks\\\" mode responses.');this.response=\\n[];}else this.response=this.responseText=\\\"\\\",this.A=new TextDecoder;ud(this);}else a.text().then(this.Ua.bind(this),this.ha.bind(this));};function ud(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a));}k.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);if(b=this.A.decode(b,{stream:!a.done}))this.response=this.responseText+=b;}a.done?td(this):sd(this);3==this.readyState&&ud(this);}};\\nk.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this));};k.Ta=function(a){this.g&&(this.response=a,td(this));};k.ha=function(){this.g&&td(this);};function td(a){a.readyState=4;a.l=null;a.j=null;a.A=null;sd(a);}k.setRequestHeader=function(a,b){this.v.append(a,b);};k.getResponseHeader=function(a){return this.h?this.h.get(a.toLowerCase())||\\\"\\\":\\\"\\\"};\\nk.getAllResponseHeaders=function(){if(!this.h)return \\\"\\\";const a=[],b=this.h.entries();for(var c=b.next();!c.done;)c=c.value,a.push(c[0]+\\\": \\\"+c[1]),c=b.next();return a.join(\\\"\\\\r\\\\n\\\")};function sd(a){a.onreadystatechange&&a.onreadystatechange.call(a);}Object.defineProperty(qd.prototype,\\\"withCredentials\\\",{get:function(){return \\\"include\\\"===this.m},set:function(a){this.m=a?\\\"include\\\":\\\"same-origin\\\";}});var vd=l.JSON.parse;function X(a){C.call(this);this.headers=new S;this.u=a||null;this.h=!1;this.C=this.g=null;this.H=\\\"\\\";this.m=0;this.j=\\\"\\\";this.l=this.F=this.v=this.D=!1;this.B=0;this.A=null;this.J=wd;this.K=this.L=!1;}t(X,C);var wd=\\\"\\\",xd=/^https?$/i,yd=[\\\"POST\\\",\\\"PUT\\\"];k=X.prototype;\\nk.ea=function(a,b,c,d){if(this.g)throw Error(\\\"[goog.net.XhrIo] Object is active with another request=\\\"+this.H+\\\"; newUri=\\\"+a);b=b?b.toUpperCase():\\\"GET\\\";this.H=a;this.j=\\\"\\\";this.m=0;this.D=!1;this.h=!0;this.g=this.u?this.u.g():cc.g();this.C=this.u?Zb(this.u):Zb(cc);this.g.onreadystatechange=q(this.Fa,this);try{this.F=!0,this.g.open(b,String(a),!0),this.F=!1;}catch(f){zd(this,f);return}a=c||\\\"\\\";const e=new S(this.headers);d&&Kc(d,function(f,h){e.set(h,f);});d=oa(e.T());c=l.FormData&&a instanceof l.FormData;\\n!(0<=ma(yd,b))||d||c||e.set(\\\"Content-Type\\\",\\\"application/x-www-form-urlencoded;charset=utf-8\\\");e.forEach(function(f,h){this.g.setRequestHeader(h,f);},this);this.J&&(this.g.responseType=this.J);\\\"withCredentials\\\"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ad(this),0<this.B&&((this.K=Bd(this.g))?(this.g.timeout=this.B,this.g.ontimeout=q(this.pa,this)):this.A=Gb(this.pa,this.B,this)),this.v=!0,this.g.send(a),this.v=!1;}catch(f){zd(this,f);}};\\nfunction Bd(a){return y&&Ra()&&\\\"number\\\"===typeof a.timeout&&void 0!==a.ontimeout}function pa(a){return \\\"content-type\\\"==a.toLowerCase()}k.pa=function(){\\\"undefined\\\"!=typeof goog&&this.g&&(this.j=\\\"Timed out after \\\"+this.B+\\\"ms, aborting\\\",this.m=8,D(this,\\\"timeout\\\"),this.abort(8));};function zd(a,b){a.h=!1;a.g&&(a.l=!0,a.g.abort(),a.l=!1);a.j=b;a.m=5;Cd(a);Dd(a);}function Cd(a){a.D||(a.D=!0,D(a,\\\"complete\\\"),D(a,\\\"error\\\"));}\\nk.abort=function(a){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=a||7,D(this,\\\"complete\\\"),D(this,\\\"abort\\\"),Dd(this));};k.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Dd(this,!0));X.Z.M.call(this);};k.Fa=function(){this.s||(this.F||this.v||this.l?Ed(this):this.cb());};k.cb=function(){Ed(this);};\\nfunction Ed(a){if(a.h&&\\\"undefined\\\"!=typeof goog&&(!a.C[1]||4!=O(a)||2!=a.ba()))if(a.v&&4==O(a))Gb(a.Fa,0,a);else if(D(a,\\\"readystatechange\\\"),4==O(a)){a.h=!1;try{const n=a.ba();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}var c;if(!(c=b)){var d;if(d=0===n){var e=String(a.H).match(Mc)[1]||null;if(!e&&l.self&&l.self.location){var f=l.self.location.protocol;e=f.substr(0,f.length-1);}d=!xd.test(e?e.toLowerCase():\\\"\\\");}c=d;}if(c)D(a,\\\"complete\\\"),D(a,\\n\\\"success\\\");else {a.m=6;try{var h=2<O(a)?a.g.statusText:\\\"\\\";}catch(u){h=\\\"\\\";}a.j=h+\\\" [\\\"+a.ba()+\\\"]\\\";Cd(a);}}finally{Dd(a);}}}function Dd(a,b){if(a.g){Ad(a);const c=a.g,d=a.C[0]?aa:null;a.g=null;a.C=null;b||D(a,\\\"ready\\\");try{c.onreadystatechange=d;}catch(e){}}}function Ad(a){a.g&&a.K&&(a.g.ontimeout=null);a.A&&(l.clearTimeout(a.A),a.A=null);}function O(a){return a.g?a.g.readyState:0}k.ba=function(){try{return 2<O(this)?this.g.status:-1}catch(a){return -1}};\\nk.ga=function(){try{return this.g?this.g.responseText:\\\"\\\"}catch(a){return \\\"\\\"}};k.Qa=function(a){if(this.g){var b=this.g.responseText;a&&0==b.indexOf(a)&&(b=b.substring(a.length));return vd(b)}};function oc(a){try{if(!a.g)return null;if(\\\"response\\\"in a.g)return a.g.response;switch(a.J){case wd:case \\\"text\\\":return a.g.responseText;case \\\"arraybuffer\\\":if(\\\"mozResponseArrayBuffer\\\"in a.g)return a.g.mozResponseArrayBuffer}return null}catch(b){return null}}k.Da=function(){return this.m};\\nk.La=function(){return \\\"string\\\"===typeof this.j?this.j:String(this.j)};function Fd(a){let b=\\\"\\\";xa(a,function(c,d){b+=d;b+=\\\":\\\";b+=c;b+=\\\"\\\\r\\\\n\\\";});return b}function Gd(a,b,c){a:{for(d in c){var d=!1;break a}d=!0;}d||(c=Fd(c),\\\"string\\\"===typeof a?(null!=c&&encodeURIComponent(String(c))):R(a,b,c));}function Hd(a,b,c){return c&&c.internalChannelParams?c.internalChannelParams[a]||b:b}\\nfunction Id(a){this.za=0;this.l=[];this.h=new Mb;this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null;this.Za=this.V=0;this.Xa=Hd(\\\"failFast\\\",!1,a);this.N=this.v=this.u=this.m=this.j=null;this.X=!0;this.I=this.ta=this.U=-1;this.Y=this.A=this.C=0;this.Pa=Hd(\\\"baseRetryDelayMs\\\",5E3,a);this.$a=Hd(\\\"retryDelaySeedMs\\\",1E4,a);this.Ya=Hd(\\\"forwardChannelMaxRetries\\\",2,a);this.ra=Hd(\\\"forwardChannelRequestTimeoutMs\\\",2E4,a);this.qa=a&&a.xmlHttpFactory||void 0;this.Ba=a&&a.Yb||!1;\\nthis.K=void 0;this.H=a&&a.supportsCrossDomainXhr||!1;this.J=\\\"\\\";this.i=new gd(a&&a.concurrentRequestLimit);this.Ca=new ld;this.ja=a&&a.fastHandshake||!1;this.Ra=a&&a.Wb||!1;a&&a.Aa&&this.h.Aa();a&&a.forceLongPolling&&(this.X=!1);this.$=!this.ja&&this.X&&a&&a.detectBufferingProxy||!1;this.ka=void 0;this.O=0;this.L=!1;this.B=null;this.Wa=!a||!1!==a.Xb;}k=Id.prototype;k.ma=8;k.G=1;\\nfunction Ic(a){Jd(a);if(3==a.G){var b=a.V++,c=N(a.F);R(c,\\\"SID\\\",a.J);R(c,\\\"RID\\\",b);R(c,\\\"TYPE\\\",\\\"terminate\\\");Kd(a,c);b=new M(a,a.h,b,void 0);b.K=2;b.v=jc(N(c));c=!1;l.navigator&&l.navigator.sendBeacon&&(c=l.navigator.sendBeacon(b.v.toString(),\\\"\\\"));!c&&l.Image&&((new Image).src=b.v,c=!0);c||(b.g=nc(b.l,null),b.g.ea(b.v));b.F=Date.now();lc(b);}Ld(a);}k.hb=function(a){try{this.h.info(\\\"Origin Trials invoked: \\\"+a);}catch(b){}};function Ac(a){a.g&&(wc(a),a.g.cancel(),a.g=null);}\\nfunction Jd(a){Ac(a);a.u&&(l.clearTimeout(a.u),a.u=null);zc(a);a.i.cancel();a.m&&(\\\"number\\\"===typeof a.m&&l.clearTimeout(a.m),a.m=null);}function Md(a,b){a.l.push(new fd(a.Za++,b));3==a.G&&Hc(a);}function Hc(a){id(a.i)||a.m||(a.m=!0,zb(a.Ha,a),a.C=0);}function Nd(a,b){if(Cc(a.i)>=a.i.j-(a.m?1:0))return !1;if(a.m)return a.l=b.D.concat(a.l),!0;if(1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya))return !1;a.m=K(q(a.Ha,a,b),Od(a,a.C));a.C++;return !0}\\nk.Ha=function(a){if(this.m)if(this.m=null,1==this.G){if(!a){this.V=Math.floor(1E5*Math.random());a=this.V++;const e=new M(this,this.h,a,void 0);let f=this.s;this.P&&(f?(f=ya(f),Aa(f,this.P)):f=this.P);null===this.o&&(e.H=f);if(this.ja)a:{var b=0;for(var c=0;c<this.l.length;c++){b:{var d=this.l[c];if(\\\"__data__\\\"in d.g&&(d=d.g.__data__,\\\"string\\\"===typeof d)){d=d.length;break b}d=void 0;}if(void 0===d)break;b+=d;if(4096<b){b=c;break a}if(4096===b||c===this.l.length-1){b=c+1;break a}}b=1E3;}else b=1E3;b=\\nPd(this,e,b);c=N(this.F);R(c,\\\"RID\\\",a);R(c,\\\"CVER\\\",22);this.D&&R(c,\\\"X-HTTP-Session-Id\\\",this.D);Kd(this,c);this.o&&f&&Gd(c,this.o,f);Dc(this.i,e);this.Ra&&R(c,\\\"TYPE\\\",\\\"init\\\");this.ja?(R(c,\\\"$req\\\",b),R(c,\\\"SID\\\",\\\"null\\\"),e.$=!0,ic(e,c,null)):ic(e,c,b);this.G=2;}}else 3==this.G&&(a?Qd(this,a):0==this.l.length||id(this.i)||Qd(this));};\\nfunction Qd(a,b){var c;b?c=b.m:c=a.V++;const d=N(a.F);R(d,\\\"SID\\\",a.J);R(d,\\\"RID\\\",c);R(d,\\\"AID\\\",a.U);Kd(a,d);a.o&&a.s&&Gd(d,a.o,a.s);c=new M(a,a.h,c,a.C+1);null===a.o&&(c.H=a.s);b&&(a.l=b.D.concat(a.l));b=Pd(a,c,1E3);c.setTimeout(Math.round(.5*a.ra)+Math.round(.5*a.ra*Math.random()));Dc(a.i,c);ic(c,d,b);}function Kd(a,b){a.j&&Kc({},function(c,d){R(b,d,c);});}\\nfunction Pd(a,b,c){c=Math.min(a.l.length,c);var d=a.j?q(a.j.Oa,a.j,a):null;a:{var e=a.l;let f=-1;for(;;){const h=[\\\"count=\\\"+c];-1==f?0<c?(f=e[0].h,h.push(\\\"ofs=\\\"+f)):f=0:h.push(\\\"ofs=\\\"+f);let n=!0;for(let u=0;u<c;u++){let m=e[u].h;const r=e[u].g;m-=f;if(0>m)f=Math.max(0,e[u].h-100),n=!1;else try{md(r,h,\\\"req\\\"+m+\\\"_\\\");}catch(G){d&&d(r);}}if(n){d=h.join(\\\"&\\\");break a}}}a=a.l.splice(0,c);b.D=a;return d}function Gc(a){a.g||a.u||(a.Y=1,zb(a.Ga,a),a.A=0);}\\nfunction Bc(a){if(a.g||a.u||3<=a.A)return !1;a.Y++;a.u=K(q(a.Ga,a),Od(a,a.A));a.A++;return !0}k.Ga=function(){this.u=null;Rd(this);if(this.$&&!(this.L||null==this.g||0>=this.O)){var a=2*this.O;this.h.info(\\\"BP detection timer enabled: \\\"+a);this.B=K(q(this.bb,this),a);}};k.bb=function(){this.B&&(this.B=null,this.h.info(\\\"BP detection timeout reached.\\\"),this.h.info(\\\"Buffering proxy detected and switch to long-polling!\\\"),this.N=!1,this.L=!0,J(10),Ac(this),Rd(this));};\\nfunction wc(a){null!=a.B&&(l.clearTimeout(a.B),a.B=null);}function Rd(a){a.g=new M(a,a.h,\\\"rpc\\\",a.Y);null===a.o&&(a.g.H=a.s);a.g.O=0;var b=N(a.oa);R(b,\\\"RID\\\",\\\"rpc\\\");R(b,\\\"SID\\\",a.J);R(b,\\\"CI\\\",a.N?\\\"0\\\":\\\"1\\\");R(b,\\\"AID\\\",a.U);Kd(a,b);R(b,\\\"TYPE\\\",\\\"xmlhttp\\\");a.o&&a.s&&Gd(b,a.o,a.s);a.K&&a.g.setTimeout(a.K);var c=a.g;a=a.la;c.K=1;c.v=jc(N(b));c.s=null;c.U=!0;kc(c,a);}k.ab=function(){null!=this.v&&(this.v=null,Ac(this),Bc(this),J(19));};function zc(a){null!=a.v&&(l.clearTimeout(a.v),a.v=null);}\\nfunction uc(a,b){var c=null;if(a.g==b){zc(a);wc(a);a.g=null;var d=2;}else if(yc(a.i,b))c=b.D,Fc(a.i,b),d=1;else return;a.I=b.N;if(0!=a.G)if(b.i)if(1==d){c=b.s?b.s.length:0;b=Date.now()-b.F;var e=a.C;d=Sb();D(d,new Vb(d,c,b,e));Hc(a);}else Gc(a);else if(e=b.o,3==e||0==e&&0<a.I||!(1==d&&Nd(a,b)||2==d&&Bc(a)))switch(c&&0<c.length&&(b=a.i,b.i=b.i.concat(c)),e){case 1:Q(a,5);break;case 4:Q(a,10);break;case 3:Q(a,6);break;default:Q(a,2);}}\\nfunction Od(a,b){let c=a.Pa+Math.floor(Math.random()*a.$a);a.j||(c*=2);return c*b}function Q(a,b){a.h.info(\\\"Error code \\\"+b);if(2==b){var c=null;a.j&&(c=null);var d=q(a.jb,a);c||(c=new U(\\\"//www.google.com/images/cleardot.gif\\\"),l.location&&\\\"http\\\"==l.location.protocol||Oc(c,\\\"https\\\"),jc(c));nd(c.toString(),d);}else J(2);a.G=0;a.j&&a.j.va(b);Ld(a);Jd(a);}k.jb=function(a){a?(this.h.info(\\\"Successfully pinged google.com\\\"),J(2)):(this.h.info(\\\"Failed to ping google.com\\\"),J(1));};\\nfunction Ld(a){a.G=0;a.I=-1;if(a.j){if(0!=jd(a.i).length||0!=a.l.length)a.i.i.length=0,ra(a.l),a.l.length=0;a.j.ua();}}function Ec(a,b,c){let d=ad(c);if(\\\"\\\"!=d.i)b&&Pc(d,b+\\\".\\\"+d.i),Qc(d,d.m);else {const e=l.location;d=bd(e.protocol,b?b+\\\".\\\"+e.hostname:e.hostname,+e.port,c);}a.aa&&xa(a.aa,function(e,f){R(d,f,e);});b=a.D;c=a.sa;b&&c&&R(d,b,c);R(d,\\\"VER\\\",a.ma);Kd(a,d);return d}\\nfunction nc(a,b,c){if(b&&!a.H)throw Error(\\\"Can't create secondary domain capable XhrIo object.\\\");b=c&&a.Ba&&!a.qa?new X(new pd({ib:!0})):new X(a.qa);b.L=a.H;return b}function Sd(){}k=Sd.prototype;k.xa=function(){};k.wa=function(){};k.va=function(){};k.ua=function(){};k.Oa=function(){};function Td(){if(y&&!(10<=Number(Ua)))throw Error(\\\"Environmental error: no available transport.\\\");}Td.prototype.g=function(a,b){return new Y(a,b)};\\nfunction Y(a,b){C.call(this);this.g=new Id(b);this.l=a;this.h=b&&b.messageUrlParams||null;a=b&&b.messageHeaders||null;b&&b.clientProtocolHeaderRequired&&(a?a[\\\"X-Client-Protocol\\\"]=\\\"webchannel\\\":a={\\\"X-Client-Protocol\\\":\\\"webchannel\\\"});this.g.s=a;a=b&&b.initMessageHeaders||null;b&&b.messageContentType&&(a?a[\\\"X-WebChannel-Content-Type\\\"]=b.messageContentType:a={\\\"X-WebChannel-Content-Type\\\":b.messageContentType});b&&b.ya&&(a?a[\\\"X-WebChannel-Client-Profile\\\"]=b.ya:a={\\\"X-WebChannel-Client-Profile\\\":b.ya});this.g.P=\\na;(a=b&&b.httpHeadersOverwriteParam)&&!sa(a)&&(this.g.o=a);this.A=b&&b.supportsCrossDomainXhr||!1;this.v=b&&b.sendRawJson||!1;(b=b&&b.httpSessionIdParam)&&!sa(b)&&(this.g.D=b,a=this.h,null!==a&&b in a&&(a=this.h,b in a&&delete a[b]));this.j=new Z(this);}t(Y,C);Y.prototype.m=function(){this.g.j=this.j;this.A&&(this.g.H=!0);var a=this.g,b=this.l,c=this.h||void 0;a.Wa&&(a.h.info(\\\"Origin Trials enabled.\\\"),zb(q(a.hb,a,b)));J(0);a.W=b;a.aa=c||{};a.N=a.X;a.F=Ec(a,null,a.W);Hc(a);};Y.prototype.close=function(){Ic(this.g);};\\nY.prototype.u=function(a){if(\\\"string\\\"===typeof a){var b={};b.__data__=a;Md(this.g,b);}else this.v?(b={},b.__data__=rb(a),Md(this.g,b)):Md(this.g,a);};Y.prototype.M=function(){this.g.j=null;delete this.j;Ic(this.g);delete this.g;Y.Z.M.call(this);};function Ud(a){ac.call(this);var b=a.__sm__;if(b){a:{for(const c in b){a=c;break a}a=void 0;}if(this.i=a)a=this.i,b=null!==b&&a in b?b[a]:void 0;this.data=b;}else this.data=a;}t(Ud,ac);function Vd(){bc.call(this);this.status=1;}t(Vd,bc);function Z(a){this.g=a;}\\nt(Z,Sd);Z.prototype.xa=function(){D(this.g,\\\"a\\\");};Z.prototype.wa=function(a){D(this.g,new Ud(a));};Z.prototype.va=function(a){D(this.g,new Vd(a));};Z.prototype.ua=function(){D(this.g,\\\"b\\\");};/*\\n\\n Copyright 2017 Google LLC\\n\\n Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n you may not use this file except in compliance with the License.\\n You may obtain a copy of the License at\\n\\n   http://www.apache.org/licenses/LICENSE-2.0\\n\\n Unless required by applicable law or agreed to in writing, software\\n distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n See the License for the specific language governing permissions and\\n limitations under the License.\\n*/\\nTd.prototype.createWebChannel=Td.prototype.g;Y.prototype.send=Y.prototype.u;Y.prototype.open=Y.prototype.m;Y.prototype.close=Y.prototype.close;Wb.NO_ERROR=0;Wb.TIMEOUT=8;Wb.HTTP_ERROR=6;Xb.COMPLETE=\\\"complete\\\";$b.EventType=L;L.OPEN=\\\"a\\\";L.CLOSE=\\\"b\\\";L.ERROR=\\\"c\\\";L.MESSAGE=\\\"d\\\";C.prototype.listen=C.prototype.N;X.prototype.listenOnce=X.prototype.O;X.prototype.getLastError=X.prototype.La;X.prototype.getLastErrorCode=X.prototype.Da;X.prototype.getStatus=X.prototype.ba;X.prototype.getResponseJson=X.prototype.Qa;\\nX.prototype.getResponseText=X.prototype.ga;X.prototype.send=X.prototype.ea;var createWebChannelTransport = esm.createWebChannelTransport=function(){return new Td};var getStatEventTarget = esm.getStatEventTarget=function(){return Sb()};var ErrorCode = esm.ErrorCode=Wb;var EventType = esm.EventType=Xb;var Event = esm.Event=H;var Stat = esm.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};var FetchXmlHttpFactory = esm.FetchXmlHttpFactory=pd;var WebChannel = esm.WebChannel=$b;\\nvar XhrIo = esm.XhrIo=X;\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/webchannel-wrapper/dist/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/app/dist/index.esm.js\":\n/*!*****************************************************!*\\\n  !*** ./node_modules/firebase/app/dist/index.esm.js ***!\n  \\*****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__._removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_app__WEBPACK_IMPORTED_MODULE_0__.setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/app */ \\\"./node_modules/@firebase/app/dist/esm/index.esm2017.js\\\");\\n\\n\\n\\nvar name = \\\"firebase\\\";\\nvar version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2020 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n(0,_firebase_app__WEBPACK_IMPORTED_MODULE_0__.registerVersion)(name, version, 'app');\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/app/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/auth/dist/index.esm.js\":\n/*!******************************************************!*\\\n  !*** ./node_modules/firebase/auth/dist/index.esm.js ***!\n  \\******************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"ActionCodeOperation\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.ActionCodeOperation),\\n/* harmony export */   \\\"ActionCodeURL\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.ActionCodeURL),\\n/* harmony export */   \\\"AuthCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.AuthCredential),\\n/* harmony export */   \\\"AuthErrorCodes\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.AuthErrorCodes),\\n/* harmony export */   \\\"EmailAuthCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.EmailAuthCredential),\\n/* harmony export */   \\\"EmailAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.EmailAuthProvider),\\n/* harmony export */   \\\"FacebookAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.FacebookAuthProvider),\\n/* harmony export */   \\\"FactorId\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.FactorId),\\n/* harmony export */   \\\"GithubAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.GithubAuthProvider),\\n/* harmony export */   \\\"GoogleAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.GoogleAuthProvider),\\n/* harmony export */   \\\"OAuthCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.OAuthCredential),\\n/* harmony export */   \\\"OAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.OAuthProvider),\\n/* harmony export */   \\\"OperationType\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.OperationType),\\n/* harmony export */   \\\"PhoneAuthCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.PhoneAuthCredential),\\n/* harmony export */   \\\"PhoneAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.PhoneAuthProvider),\\n/* harmony export */   \\\"PhoneMultiFactorGenerator\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.PhoneMultiFactorGenerator),\\n/* harmony export */   \\\"ProviderId\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.ProviderId),\\n/* harmony export */   \\\"RecaptchaVerifier\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.RecaptchaVerifier),\\n/* harmony export */   \\\"SAMLAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.SAMLAuthProvider),\\n/* harmony export */   \\\"SignInMethod\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.SignInMethod),\\n/* harmony export */   \\\"TwitterAuthProvider\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.TwitterAuthProvider),\\n/* harmony export */   \\\"applyActionCode\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.applyActionCode),\\n/* harmony export */   \\\"beforeAuthStateChanged\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.beforeAuthStateChanged),\\n/* harmony export */   \\\"browserLocalPersistence\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.browserLocalPersistence),\\n/* harmony export */   \\\"browserPopupRedirectResolver\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.browserPopupRedirectResolver),\\n/* harmony export */   \\\"browserSessionPersistence\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.browserSessionPersistence),\\n/* harmony export */   \\\"checkActionCode\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.checkActionCode),\\n/* harmony export */   \\\"confirmPasswordReset\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.confirmPasswordReset),\\n/* harmony export */   \\\"connectAuthEmulator\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.connectAuthEmulator),\\n/* harmony export */   \\\"createUserWithEmailAndPassword\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.createUserWithEmailAndPassword),\\n/* harmony export */   \\\"debugErrorMap\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.debugErrorMap),\\n/* harmony export */   \\\"deleteUser\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.deleteUser),\\n/* harmony export */   \\\"fetchSignInMethodsForEmail\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.fetchSignInMethodsForEmail),\\n/* harmony export */   \\\"getAdditionalUserInfo\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.getAdditionalUserInfo),\\n/* harmony export */   \\\"getAuth\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.getAuth),\\n/* harmony export */   \\\"getIdToken\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.getIdToken),\\n/* harmony export */   \\\"getIdTokenResult\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.getIdTokenResult),\\n/* harmony export */   \\\"getMultiFactorResolver\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.getMultiFactorResolver),\\n/* harmony export */   \\\"getRedirectResult\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.getRedirectResult),\\n/* harmony export */   \\\"inMemoryPersistence\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.inMemoryPersistence),\\n/* harmony export */   \\\"indexedDBLocalPersistence\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.indexedDBLocalPersistence),\\n/* harmony export */   \\\"initializeAuth\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.initializeAuth),\\n/* harmony export */   \\\"isSignInWithEmailLink\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.isSignInWithEmailLink),\\n/* harmony export */   \\\"linkWithCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.linkWithCredential),\\n/* harmony export */   \\\"linkWithPhoneNumber\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.linkWithPhoneNumber),\\n/* harmony export */   \\\"linkWithPopup\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.linkWithPopup),\\n/* harmony export */   \\\"linkWithRedirect\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.linkWithRedirect),\\n/* harmony export */   \\\"multiFactor\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.multiFactor),\\n/* harmony export */   \\\"onAuthStateChanged\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.onAuthStateChanged),\\n/* harmony export */   \\\"onIdTokenChanged\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.onIdTokenChanged),\\n/* harmony export */   \\\"parseActionCodeURL\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.parseActionCodeURL),\\n/* harmony export */   \\\"prodErrorMap\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.prodErrorMap),\\n/* harmony export */   \\\"reauthenticateWithCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.reauthenticateWithCredential),\\n/* harmony export */   \\\"reauthenticateWithPhoneNumber\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.reauthenticateWithPhoneNumber),\\n/* harmony export */   \\\"reauthenticateWithPopup\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.reauthenticateWithPopup),\\n/* harmony export */   \\\"reauthenticateWithRedirect\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.reauthenticateWithRedirect),\\n/* harmony export */   \\\"reload\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.reload),\\n/* harmony export */   \\\"sendEmailVerification\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.sendEmailVerification),\\n/* harmony export */   \\\"sendPasswordResetEmail\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.sendPasswordResetEmail),\\n/* harmony export */   \\\"sendSignInLinkToEmail\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.sendSignInLinkToEmail),\\n/* harmony export */   \\\"setPersistence\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.setPersistence),\\n/* harmony export */   \\\"signInAnonymously\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInAnonymously),\\n/* harmony export */   \\\"signInWithCredential\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithCredential),\\n/* harmony export */   \\\"signInWithCustomToken\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithCustomToken),\\n/* harmony export */   \\\"signInWithEmailAndPassword\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithEmailAndPassword),\\n/* harmony export */   \\\"signInWithEmailLink\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithEmailLink),\\n/* harmony export */   \\\"signInWithPhoneNumber\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithPhoneNumber),\\n/* harmony export */   \\\"signInWithPopup\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithPopup),\\n/* harmony export */   \\\"signInWithRedirect\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signInWithRedirect),\\n/* harmony export */   \\\"signOut\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.signOut),\\n/* harmony export */   \\\"unlink\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.unlink),\\n/* harmony export */   \\\"updateCurrentUser\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.updateCurrentUser),\\n/* harmony export */   \\\"updateEmail\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.updateEmail),\\n/* harmony export */   \\\"updatePassword\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.updatePassword),\\n/* harmony export */   \\\"updatePhoneNumber\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.updatePhoneNumber),\\n/* harmony export */   \\\"updateProfile\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.updateProfile),\\n/* harmony export */   \\\"useDeviceLanguage\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.useDeviceLanguage),\\n/* harmony export */   \\\"verifyBeforeUpdateEmail\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.verifyBeforeUpdateEmail),\\n/* harmony export */   \\\"verifyPasswordResetCode\\\": () => (/* reexport safe */ _firebase_auth__WEBPACK_IMPORTED_MODULE_0__.verifyPasswordResetCode)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_auth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/auth */ \\\"./node_modules/@firebase/auth/dist/esm2017/index.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/auth/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/firebase/firestore/dist/index.esm.js\":\n/*!***********************************************************!*\\\n  !*** ./node_modules/firebase/firestore/dist/index.esm.js ***!\n  \\***********************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"AbstractUserDataWriter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.AbstractUserDataWriter),\\n/* harmony export */   \\\"Bytes\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Bytes),\\n/* harmony export */   \\\"CACHE_SIZE_UNLIMITED\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CACHE_SIZE_UNLIMITED),\\n/* harmony export */   \\\"CollectionReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.CollectionReference),\\n/* harmony export */   \\\"DocumentReference\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentReference),\\n/* harmony export */   \\\"DocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.DocumentSnapshot),\\n/* harmony export */   \\\"FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldPath),\\n/* harmony export */   \\\"FieldValue\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FieldValue),\\n/* harmony export */   \\\"Firestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Firestore),\\n/* harmony export */   \\\"FirestoreError\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.FirestoreError),\\n/* harmony export */   \\\"GeoPoint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.GeoPoint),\\n/* harmony export */   \\\"LoadBundleTask\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.LoadBundleTask),\\n/* harmony export */   \\\"Query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Query),\\n/* harmony export */   \\\"QueryConstraint\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryConstraint),\\n/* harmony export */   \\\"QueryDocumentSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentSnapshot),\\n/* harmony export */   \\\"QuerySnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.QuerySnapshot),\\n/* harmony export */   \\\"SnapshotMetadata\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.SnapshotMetadata),\\n/* harmony export */   \\\"Timestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Timestamp),\\n/* harmony export */   \\\"Transaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.Transaction),\\n/* harmony export */   \\\"WriteBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.WriteBatch),\\n/* harmony export */   \\\"_DatabaseId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DatabaseId),\\n/* harmony export */   \\\"_DocumentKey\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._DocumentKey),\\n/* harmony export */   \\\"_EmptyAppCheckTokenProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAppCheckTokenProvider),\\n/* harmony export */   \\\"_EmptyAuthCredentialsProvider\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._EmptyAuthCredentialsProvider),\\n/* harmony export */   \\\"_FieldPath\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._FieldPath),\\n/* harmony export */   \\\"_cast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._cast),\\n/* harmony export */   \\\"_debugAssert\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._debugAssert),\\n/* harmony export */   \\\"_isBase64Available\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._isBase64Available),\\n/* harmony export */   \\\"_logWarn\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._logWarn),\\n/* harmony export */   \\\"_setIndexConfiguration\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._setIndexConfiguration),\\n/* harmony export */   \\\"_validateIsNotUsedTogether\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__._validateIsNotUsedTogether),\\n/* harmony export */   \\\"addDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.addDoc),\\n/* harmony export */   \\\"arrayRemove\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayRemove),\\n/* harmony export */   \\\"arrayUnion\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.arrayUnion),\\n/* harmony export */   \\\"clearIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.clearIndexedDbPersistence),\\n/* harmony export */   \\\"collection\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collection),\\n/* harmony export */   \\\"collectionGroup\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.collectionGroup),\\n/* harmony export */   \\\"connectFirestoreEmulator\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.connectFirestoreEmulator),\\n/* harmony export */   \\\"deleteDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteDoc),\\n/* harmony export */   \\\"deleteField\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.deleteField),\\n/* harmony export */   \\\"disableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.disableNetwork),\\n/* harmony export */   \\\"doc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.doc),\\n/* harmony export */   \\\"documentId\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.documentId),\\n/* harmony export */   \\\"enableIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableIndexedDbPersistence),\\n/* harmony export */   \\\"enableMultiTabIndexedDbPersistence\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableMultiTabIndexedDbPersistence),\\n/* harmony export */   \\\"enableNetwork\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.enableNetwork),\\n/* harmony export */   \\\"endAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endAt),\\n/* harmony export */   \\\"endBefore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.endBefore),\\n/* harmony export */   \\\"ensureFirestoreConfigured\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.ensureFirestoreConfigured),\\n/* harmony export */   \\\"executeWrite\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.executeWrite),\\n/* harmony export */   \\\"getDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDoc),\\n/* harmony export */   \\\"getDocFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromCache),\\n/* harmony export */   \\\"getDocFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocFromServer),\\n/* harmony export */   \\\"getDocs\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocs),\\n/* harmony export */   \\\"getDocsFromCache\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromCache),\\n/* harmony export */   \\\"getDocsFromServer\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getDocsFromServer),\\n/* harmony export */   \\\"getFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.getFirestore),\\n/* harmony export */   \\\"increment\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.increment),\\n/* harmony export */   \\\"initializeFirestore\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.initializeFirestore),\\n/* harmony export */   \\\"limit\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limit),\\n/* harmony export */   \\\"limitToLast\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.limitToLast),\\n/* harmony export */   \\\"loadBundle\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.loadBundle),\\n/* harmony export */   \\\"namedQuery\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.namedQuery),\\n/* harmony export */   \\\"onSnapshot\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshot),\\n/* harmony export */   \\\"onSnapshotsInSync\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.onSnapshotsInSync),\\n/* harmony export */   \\\"orderBy\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.orderBy),\\n/* harmony export */   \\\"query\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.query),\\n/* harmony export */   \\\"queryEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.queryEqual),\\n/* harmony export */   \\\"refEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.refEqual),\\n/* harmony export */   \\\"runTransaction\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.runTransaction),\\n/* harmony export */   \\\"serverTimestamp\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.serverTimestamp),\\n/* harmony export */   \\\"setDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setDoc),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.setLogLevel),\\n/* harmony export */   \\\"snapshotEqual\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.snapshotEqual),\\n/* harmony export */   \\\"startAfter\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAfter),\\n/* harmony export */   \\\"startAt\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.startAt),\\n/* harmony export */   \\\"terminate\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.terminate),\\n/* harmony export */   \\\"updateDoc\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.updateDoc),\\n/* harmony export */   \\\"waitForPendingWrites\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.waitForPendingWrites),\\n/* harmony export */   \\\"where\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.where),\\n/* harmony export */   \\\"writeBatch\\\": () => (/* reexport safe */ _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__.writeBatch)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_firestore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/firestore */ \\\"./node_modules/@firebase/firestore/dist/index.esm2017.js\\\");\\n\\n//# sourceMappingURL=index.esm.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/firebase/firestore/dist/index.esm.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/tslib/tslib.es6.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/tslib/tslib.es6.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"__extends\\\": () => (/* binding */ __extends),\\n/* harmony export */   \\\"__assign\\\": () => (/* binding */ __assign),\\n/* harmony export */   \\\"__rest\\\": () => (/* binding */ __rest),\\n/* harmony export */   \\\"__decorate\\\": () => (/* binding */ __decorate),\\n/* harmony export */   \\\"__param\\\": () => (/* binding */ __param),\\n/* harmony export */   \\\"__metadata\\\": () => (/* binding */ __metadata),\\n/* harmony export */   \\\"__awaiter\\\": () => (/* binding */ __awaiter),\\n/* harmony export */   \\\"__generator\\\": () => (/* binding */ __generator),\\n/* harmony export */   \\\"__createBinding\\\": () => (/* binding */ __createBinding),\\n/* harmony export */   \\\"__exportStar\\\": () => (/* binding */ __exportStar),\\n/* harmony export */   \\\"__values\\\": () => (/* binding */ __values),\\n/* harmony export */   \\\"__read\\\": () => (/* binding */ __read),\\n/* harmony export */   \\\"__spread\\\": () => (/* binding */ __spread),\\n/* harmony export */   \\\"__spreadArrays\\\": () => (/* binding */ __spreadArrays),\\n/* harmony export */   \\\"__spreadArray\\\": () => (/* binding */ __spreadArray),\\n/* harmony export */   \\\"__await\\\": () => (/* binding */ __await),\\n/* harmony export */   \\\"__asyncGenerator\\\": () => (/* binding */ __asyncGenerator),\\n/* harmony export */   \\\"__asyncDelegator\\\": () => (/* binding */ __asyncDelegator),\\n/* harmony export */   \\\"__asyncValues\\\": () => (/* binding */ __asyncValues),\\n/* harmony export */   \\\"__makeTemplateObject\\\": () => (/* binding */ __makeTemplateObject),\\n/* harmony export */   \\\"__importStar\\\": () => (/* binding */ __importStar),\\n/* harmony export */   \\\"__importDefault\\\": () => (/* binding */ __importDefault),\\n/* harmony export */   \\\"__classPrivateFieldGet\\\": () => (/* binding */ __classPrivateFieldGet),\\n/* harmony export */   \\\"__classPrivateFieldSet\\\": () => (/* binding */ __classPrivateFieldSet),\\n/* harmony export */   \\\"__classPrivateFieldIn\\\": () => (/* binding */ __classPrivateFieldIn)\\n/* harmony export */ });\\n/******************************************************************************\\r\\nCopyright (c) Microsoft Corporation.\\r\\n\\r\\nPermission to use, copy, modify, and/or distribute this software for any\\r\\npurpose with or without fee is hereby granted.\\r\\n\\r\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\\r\\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\\r\\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\\r\\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\\r\\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\\r\\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\\r\\nPERFORMANCE OF THIS SOFTWARE.\\r\\n***************************************************************************** */\\r\\n/* global Reflect, Promise */\\r\\n\\r\\nvar extendStatics = function(d, b) {\\r\\n    extendStatics = Object.setPrototypeOf ||\\r\\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\\r\\n        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\\r\\n    return extendStatics(d, b);\\r\\n};\\r\\n\\r\\nfunction __extends(d, b) {\\r\\n    if (typeof b !== \\\"function\\\" && b !== null)\\r\\n        throw new TypeError(\\\"Class extends value \\\" + String(b) + \\\" is not a constructor or null\\\");\\r\\n    extendStatics(d, b);\\r\\n    function __() { this.constructor = d; }\\r\\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\\r\\n}\\r\\n\\r\\nvar __assign = function() {\\r\\n    __assign = Object.assign || function __assign(t) {\\r\\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\\r\\n            s = arguments[i];\\r\\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\\r\\n        }\\r\\n        return t;\\r\\n    }\\r\\n    return __assign.apply(this, arguments);\\r\\n}\\r\\n\\r\\nfunction __rest(s, e) {\\r\\n    var t = {};\\r\\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\\r\\n        t[p] = s[p];\\r\\n    if (s != null && typeof Object.getOwnPropertySymbols === \\\"function\\\")\\r\\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\\r\\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\\r\\n                t[p[i]] = s[p[i]];\\r\\n        }\\r\\n    return t;\\r\\n}\\r\\n\\r\\nfunction __decorate(decorators, target, key, desc) {\\r\\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\\r\\n    if (typeof Reflect === \\\"object\\\" && typeof Reflect.decorate === \\\"function\\\") r = Reflect.decorate(decorators, target, key, desc);\\r\\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\\r\\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\\r\\n}\\r\\n\\r\\nfunction __param(paramIndex, decorator) {\\r\\n    return function (target, key) { decorator(target, key, paramIndex); }\\r\\n}\\r\\n\\r\\nfunction __metadata(metadataKey, metadataValue) {\\r\\n    if (typeof Reflect === \\\"object\\\" && typeof Reflect.metadata === \\\"function\\\") return Reflect.metadata(metadataKey, metadataValue);\\r\\n}\\r\\n\\r\\nfunction __awaiter(thisArg, _arguments, P, generator) {\\r\\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\\r\\n    return new (P || (P = Promise))(function (resolve, reject) {\\r\\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\\r\\n        function rejected(value) { try { step(generator[\\\"throw\\\"](value)); } catch (e) { reject(e); } }\\r\\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\\r\\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\\r\\n    });\\r\\n}\\r\\n\\r\\nfunction __generator(thisArg, body) {\\r\\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\\r\\n    return g = { next: verb(0), \\\"throw\\\": verb(1), \\\"return\\\": verb(2) }, typeof Symbol === \\\"function\\\" && (g[Symbol.iterator] = function() { return this; }), g;\\r\\n    function verb(n) { return function (v) { return step([n, v]); }; }\\r\\n    function step(op) {\\r\\n        if (f) throw new TypeError(\\\"Generator is already executing.\\\");\\r\\n        while (_) try {\\r\\n            if (f = 1, y && (t = op[0] & 2 ? y[\\\"return\\\"] : op[0] ? y[\\\"throw\\\"] || ((t = y[\\\"return\\\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\\r\\n            if (y = 0, t) op = [op[0] & 2, t.value];\\r\\n            switch (op[0]) {\\r\\n                case 0: case 1: t = op; break;\\r\\n                case 4: _.label++; return { value: op[1], done: false };\\r\\n                case 5: _.label++; y = op[1]; op = [0]; continue;\\r\\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\\r\\n                default:\\r\\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\\r\\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\\r\\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\\r\\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\\r\\n                    if (t[2]) _.ops.pop();\\r\\n                    _.trys.pop(); continue;\\r\\n            }\\r\\n            op = body.call(thisArg, _);\\r\\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\\r\\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\\r\\n    }\\r\\n}\\r\\n\\r\\nvar __createBinding = Object.create ? (function(o, m, k, k2) {\\r\\n    if (k2 === undefined) k2 = k;\\r\\n    var desc = Object.getOwnPropertyDescriptor(m, k);\\r\\n    if (!desc || (\\\"get\\\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\\r\\n        desc = { enumerable: true, get: function() { return m[k]; } };\\r\\n    }\\r\\n    Object.defineProperty(o, k2, desc);\\r\\n}) : (function(o, m, k, k2) {\\r\\n    if (k2 === undefined) k2 = k;\\r\\n    o[k2] = m[k];\\r\\n});\\r\\n\\r\\nfunction __exportStar(m, o) {\\r\\n    for (var p in m) if (p !== \\\"default\\\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\\r\\n}\\r\\n\\r\\nfunction __values(o) {\\r\\n    var s = typeof Symbol === \\\"function\\\" && Symbol.iterator, m = s && o[s], i = 0;\\r\\n    if (m) return m.call(o);\\r\\n    if (o && typeof o.length === \\\"number\\\") return {\\r\\n        next: function () {\\r\\n            if (o && i >= o.length) o = void 0;\\r\\n            return { value: o && o[i++], done: !o };\\r\\n        }\\r\\n    };\\r\\n    throw new TypeError(s ? \\\"Object is not iterable.\\\" : \\\"Symbol.iterator is not defined.\\\");\\r\\n}\\r\\n\\r\\nfunction __read(o, n) {\\r\\n    var m = typeof Symbol === \\\"function\\\" && o[Symbol.iterator];\\r\\n    if (!m) return o;\\r\\n    var i = m.call(o), r, ar = [], e;\\r\\n    try {\\r\\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\\r\\n    }\\r\\n    catch (error) { e = { error: error }; }\\r\\n    finally {\\r\\n        try {\\r\\n            if (r && !r.done && (m = i[\\\"return\\\"])) m.call(i);\\r\\n        }\\r\\n        finally { if (e) throw e.error; }\\r\\n    }\\r\\n    return ar;\\r\\n}\\r\\n\\r\\n/** @deprecated */\\r\\nfunction __spread() {\\r\\n    for (var ar = [], i = 0; i < arguments.length; i++)\\r\\n        ar = ar.concat(__read(arguments[i]));\\r\\n    return ar;\\r\\n}\\r\\n\\r\\n/** @deprecated */\\r\\nfunction __spreadArrays() {\\r\\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\\r\\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\\r\\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\\r\\n            r[k] = a[j];\\r\\n    return r;\\r\\n}\\r\\n\\r\\nfunction __spreadArray(to, from, pack) {\\r\\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\\r\\n        if (ar || !(i in from)) {\\r\\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\\r\\n            ar[i] = from[i];\\r\\n        }\\r\\n    }\\r\\n    return to.concat(ar || Array.prototype.slice.call(from));\\r\\n}\\r\\n\\r\\nfunction __await(v) {\\r\\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\\r\\n}\\r\\n\\r\\nfunction __asyncGenerator(thisArg, _arguments, generator) {\\r\\n    if (!Symbol.asyncIterator) throw new TypeError(\\\"Symbol.asyncIterator is not defined.\\\");\\r\\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\\r\\n    return i = {}, verb(\\\"next\\\"), verb(\\\"throw\\\"), verb(\\\"return\\\"), i[Symbol.asyncIterator] = function () { return this; }, i;\\r\\n    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\\r\\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\\r\\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\\r\\n    function fulfill(value) { resume(\\\"next\\\", value); }\\r\\n    function reject(value) { resume(\\\"throw\\\", value); }\\r\\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\\r\\n}\\r\\n\\r\\nfunction __asyncDelegator(o) {\\r\\n    var i, p;\\r\\n    return i = {}, verb(\\\"next\\\"), verb(\\\"throw\\\", function (e) { throw e; }), verb(\\\"return\\\"), i[Symbol.iterator] = function () { return this; }, i;\\r\\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \\\"return\\\" } : f ? f(v) : v; } : f; }\\r\\n}\\r\\n\\r\\nfunction __asyncValues(o) {\\r\\n    if (!Symbol.asyncIterator) throw new TypeError(\\\"Symbol.asyncIterator is not defined.\\\");\\r\\n    var m = o[Symbol.asyncIterator], i;\\r\\n    return m ? m.call(o) : (o = typeof __values === \\\"function\\\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\\\"next\\\"), verb(\\\"throw\\\"), verb(\\\"return\\\"), i[Symbol.asyncIterator] = function () { return this; }, i);\\r\\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\\r\\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\\r\\n}\\r\\n\\r\\nfunction __makeTemplateObject(cooked, raw) {\\r\\n    if (Object.defineProperty) { Object.defineProperty(cooked, \\\"raw\\\", { value: raw }); } else { cooked.raw = raw; }\\r\\n    return cooked;\\r\\n};\\r\\n\\r\\nvar __setModuleDefault = Object.create ? (function(o, v) {\\r\\n    Object.defineProperty(o, \\\"default\\\", { enumerable: true, value: v });\\r\\n}) : function(o, v) {\\r\\n    o[\\\"default\\\"] = v;\\r\\n};\\r\\n\\r\\nfunction __importStar(mod) {\\r\\n    if (mod && mod.__esModule) return mod;\\r\\n    var result = {};\\r\\n    if (mod != null) for (var k in mod) if (k !== \\\"default\\\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\\r\\n    __setModuleDefault(result, mod);\\r\\n    return result;\\r\\n}\\r\\n\\r\\nfunction __importDefault(mod) {\\r\\n    return (mod && mod.__esModule) ? mod : { default: mod };\\r\\n}\\r\\n\\r\\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\\r\\n    if (kind === \\\"a\\\" && !f) throw new TypeError(\\\"Private accessor was defined without a getter\\\");\\r\\n    if (typeof state === \\\"function\\\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\\\"Cannot read private member from an object whose class did not declare it\\\");\\r\\n    return kind === \\\"m\\\" ? f : kind === \\\"a\\\" ? f.call(receiver) : f ? f.value : state.get(receiver);\\r\\n}\\r\\n\\r\\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\\r\\n    if (kind === \\\"m\\\") throw new TypeError(\\\"Private method is not writable\\\");\\r\\n    if (kind === \\\"a\\\" && !f) throw new TypeError(\\\"Private accessor was defined without a setter\\\");\\r\\n    if (typeof state === \\\"function\\\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\\\"Cannot write private member to an object whose class did not declare it\\\");\\r\\n    return (kind === \\\"a\\\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\\r\\n}\\r\\n\\r\\nfunction __classPrivateFieldIn(state, receiver) {\\r\\n    if (receiver === null || (typeof receiver !== \\\"object\\\" && typeof receiver !== \\\"function\\\")) throw new TypeError(\\\"Cannot use 'in' operator on non-object\\\");\\r\\n    return typeof state === \\\"function\\\" ? receiver === state : state.has(receiver);\\r\\n}\\r\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/tslib/tslib.es6.js?\");\n\n/***/ }),\n\n/***/ \"./src/index.js\":\n/*!**********************!*\\\n  !*** ./src/index.js ***!\n  \\**********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! firebase/app */ \\\"./node_modules/firebase/app/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/firestore */ \\\"./node_modules/firebase/firestore/dist/index.esm.js\\\");\\n/* harmony import */ var firebase_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! firebase/auth */ \\\"./node_modules/firebase/auth/dist/index.esm.js\\\");\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\nconst firebaseConfig = {\\r\\n  apiKey: \\\"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\\\",\\r\\n  authDomain: \\\"notnotion-defa4.firebaseapp.com\\\",\\r\\n  projectId: \\\"notnotion-defa4\\\",\\r\\n  storageBucket: \\\"notnotion-defa4.appspot.com\\\",\\r\\n  messagingSenderId: \\\"63313643087\\\",\\r\\n  appId: \\\"1:63313643087:web:fd1e442f73022ffa660c3a\\\"\\r\\n};\\r\\n\\r\\n\\r\\nconst app = (0,firebase_app__WEBPACK_IMPORTED_MODULE_0__.initializeApp)(firebaseConfig);\\r\\nconst db = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getFirestore)();\\r\\nconst auth = (0,firebase_auth__WEBPACK_IMPORTED_MODULE_2__.getAuth)();\\r\\n\\r\\nconst colRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.collection)(db, \\\"movies\\\");\\r\\nconst qRef = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.query)(colRef, (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.where)(\\\"category\\\", \\\"==\\\", \\\"drama\\\"), (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.orderBy)(\\\"createdAt\\\"));\\r\\n\\r\\n\\r\\n// const documentReference = doc(db, \\\"movies\\\", \\\"uwmpf5Z4D3N1maXYlfHn\\\");\\r\\n// onSnapshot(documentReference, (document) => {\\r\\n//     console.log(document.data(), document.id);\\r\\n// });\\r\\n\\r\\n\\r\\n(0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.getDocs)(colRef)\\r\\n    .then(data => {\\r\\n        let movies = [];\\r\\n        data.docs.forEach(document => {\\r\\n            movies.push({...document.data(), id: document.id});\\r\\n        });\\r\\n        console.log(movies);\\r\\n    })\\r\\n    .catch(error => {\\r\\n        console.log(error);\\r\\n    });\\r\\n\\r\\n\\r\\n// onSnapshot(colRef, (data) => {\\r\\n//     let movies = [];\\r\\n//     data.docs.forEach(document => {\\r\\n//         movies.push({...document.data(), id: document.id});\\r\\n//     });\\r\\n//     console.log(movies);\\r\\n// });\\r\\n\\r\\n\\r\\nconst addForm = document.querySelector(\\\".add\\\");\\r\\naddForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.addDoc)(colRef, {\\r\\n        name: addForm.name.value,\\r\\n        category: addForm.category.value,\\r\\n        createdAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)(),\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        addForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst deleteForm = document.querySelector(\\\".delete\\\");\\r\\ndeleteForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n    \\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", deleteForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.deleteDoc)(documentReference)\\r\\n    .then(() => {\\r\\n            deleteForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst updateForm = document.querySelector(\\\".update\\\");\\r\\nupdateForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const documentReference = (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.doc)(db, \\\"movies\\\", updateForm.id.value);\\r\\n    (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.updateDoc)(documentReference, {\\r\\n        name: updateForm.name.value,\\r\\n        updatedAt: (0,firebase_firestore__WEBPACK_IMPORTED_MODULE_1__.serverTimestamp)()\\r\\n    })\\r\\n    .then(() => {\\r\\n        updateForm.reset();\\r\\n    });\\r\\n});\\r\\n\\r\\n\\r\\nconst registerForm = document.querySelector(\\\".register\\\");\\r\\nregisterForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n\\r\\n    (0,firebase_auth__WEBPACK_IMPORTED_MODULE_2__.createUserWithEmailAndPassword)(auth, registerForm.email.value, registerForm.password.value)\\r\\n        .then(credentials => {\\r\\n            console.log(credentials);\\r\\n            registerForm.reset();\\r\\n        })\\r\\n        .catch(error => {\\r\\n            console.log(error);\\r\\n        })\\r\\n});\\r\\n\\r\\n\\r\\nconst logoutButton = document.querySelector(\\\".logout\\\");\\r\\nlogoutButton.addEventListener(\\\"click\\\", event => {\\r\\n    (0,firebase_auth__WEBPACK_IMPORTED_MODULE_2__.signOut)(auth)\\r\\n        .then(() => {\\r\\n            console.log(\\\"User Logged Out!\\\")\\r\\n        })\\r\\n        .catch(error => {\\r\\n            console.log(error);\\r\\n        });\\r\\n});\\r\\n\\r\\n\\r\\nconst loginForm = document.querySelector(\\\".login\\\");\\r\\nloginForm.addEventListener(\\\"submit\\\", event => {\\r\\n    event.preventDefault();\\r\\n\\r\\n    (0,firebase_auth__WEBPACK_IMPORTED_MODULE_2__.signInWithEmailAndPassword)(auth, loginForm.email.value, loginForm.password.value)\\r\\n        .then(credentials => {\\r\\n            console.log(credentials.user);\\r\\n            loginForm.reset();\\r\\n        })\\r\\n        .catch(error => {\\r\\n            console.log(error);\\r\\n        })\\r\\n})\\n\\n//# sourceURL=webpack://unwiredjs/./src/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/app/dist/esm/index.esm2017.js\":\n/*!**************************************************************!*\\\n  !*** ./node_modules/@firebase/app/dist/esm/index.esm2017.js ***!\n  \\**************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"FirebaseError\\\": () => (/* reexport safe */ _firebase_util__WEBPACK_IMPORTED_MODULE_2__.FirebaseError),\\n/* harmony export */   \\\"SDK_VERSION\\\": () => (/* binding */ SDK_VERSION),\\n/* harmony export */   \\\"_DEFAULT_ENTRY_NAME\\\": () => (/* binding */ DEFAULT_ENTRY_NAME),\\n/* harmony export */   \\\"_addComponent\\\": () => (/* binding */ _addComponent),\\n/* harmony export */   \\\"_addOrOverwriteComponent\\\": () => (/* binding */ _addOrOverwriteComponent),\\n/* harmony export */   \\\"_apps\\\": () => (/* binding */ _apps),\\n/* harmony export */   \\\"_clearComponents\\\": () => (/* binding */ _clearComponents),\\n/* harmony export */   \\\"_components\\\": () => (/* binding */ _components),\\n/* harmony export */   \\\"_getProvider\\\": () => (/* binding */ _getProvider),\\n/* harmony export */   \\\"_registerComponent\\\": () => (/* binding */ _registerComponent),\\n/* harmony export */   \\\"_removeServiceInstance\\\": () => (/* binding */ _removeServiceInstance),\\n/* harmony export */   \\\"deleteApp\\\": () => (/* binding */ deleteApp),\\n/* harmony export */   \\\"getApp\\\": () => (/* binding */ getApp),\\n/* harmony export */   \\\"getApps\\\": () => (/* binding */ getApps),\\n/* harmony export */   \\\"initializeApp\\\": () => (/* binding */ initializeApp),\\n/* harmony export */   \\\"onLog\\\": () => (/* binding */ onLog),\\n/* harmony export */   \\\"registerVersion\\\": () => (/* binding */ registerVersion),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/component */ \\\"./node_modules/@firebase/component/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @firebase/logger */ \\\"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\\\");\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n/* harmony import */ var idb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! idb */ \\\"./node_modules/idb/build/index.js\\\");\\n\\n\\n\\n\\n\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass PlatformLoggerServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n    }\\r\\n    // In initial implementation, this will be called by installations on\\r\\n    // auth token refresh, and installations will send this string.\\r\\n    getPlatformInfoString() {\\r\\n        const providers = this.container.getProviders();\\r\\n        // Loop through providers and get library/version pairs from any that are\\r\\n        // version components.\\r\\n        return providers\\r\\n            .map(provider => {\\r\\n            if (isVersionServiceProvider(provider)) {\\r\\n                const service = provider.getImmediate();\\r\\n                return `${service.library}/${service.version}`;\\r\\n            }\\r\\n            else {\\r\\n                return null;\\r\\n            }\\r\\n        })\\r\\n            .filter(logString => logString)\\r\\n            .join(' ');\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param provider check if this provider provides a VersionService\\r\\n *\\r\\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\\r\\n * provides VersionService. The provider is not necessarily a 'app-version'\\r\\n * provider.\\r\\n */\\r\\nfunction isVersionServiceProvider(provider) {\\r\\n    const component = provider.getComponent();\\r\\n    return (component === null || component === void 0 ? void 0 : component.type) === \\\"VERSION\\\" /* VERSION */;\\r\\n}\\n\\nconst name$o = \\\"@firebase/app\\\";\\nconst version$1 = \\\"0.7.24\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst logger = new _firebase_logger__WEBPACK_IMPORTED_MODULE_1__.Logger('@firebase/app');\\n\\nconst name$n = \\\"@firebase/app-compat\\\";\\n\\nconst name$m = \\\"@firebase/analytics-compat\\\";\\n\\nconst name$l = \\\"@firebase/analytics\\\";\\n\\nconst name$k = \\\"@firebase/app-check-compat\\\";\\n\\nconst name$j = \\\"@firebase/app-check\\\";\\n\\nconst name$i = \\\"@firebase/auth\\\";\\n\\nconst name$h = \\\"@firebase/auth-compat\\\";\\n\\nconst name$g = \\\"@firebase/database\\\";\\n\\nconst name$f = \\\"@firebase/database-compat\\\";\\n\\nconst name$e = \\\"@firebase/functions\\\";\\n\\nconst name$d = \\\"@firebase/functions-compat\\\";\\n\\nconst name$c = \\\"@firebase/installations\\\";\\n\\nconst name$b = \\\"@firebase/installations-compat\\\";\\n\\nconst name$a = \\\"@firebase/messaging\\\";\\n\\nconst name$9 = \\\"@firebase/messaging-compat\\\";\\n\\nconst name$8 = \\\"@firebase/performance\\\";\\n\\nconst name$7 = \\\"@firebase/performance-compat\\\";\\n\\nconst name$6 = \\\"@firebase/remote-config\\\";\\n\\nconst name$5 = \\\"@firebase/remote-config-compat\\\";\\n\\nconst name$4 = \\\"@firebase/storage\\\";\\n\\nconst name$3 = \\\"@firebase/storage-compat\\\";\\n\\nconst name$2 = \\\"@firebase/firestore\\\";\\n\\nconst name$1 = \\\"@firebase/firestore-compat\\\";\\n\\nconst name = \\\"firebase\\\";\\nconst version = \\\"9.8.1\\\";\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The default app name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\r\\nconst PLATFORM_LOG_STRING = {\\r\\n    [name$o]: 'fire-core',\\r\\n    [name$n]: 'fire-core-compat',\\r\\n    [name$l]: 'fire-analytics',\\r\\n    [name$m]: 'fire-analytics-compat',\\r\\n    [name$j]: 'fire-app-check',\\r\\n    [name$k]: 'fire-app-check-compat',\\r\\n    [name$i]: 'fire-auth',\\r\\n    [name$h]: 'fire-auth-compat',\\r\\n    [name$g]: 'fire-rtdb',\\r\\n    [name$f]: 'fire-rtdb-compat',\\r\\n    [name$e]: 'fire-fn',\\r\\n    [name$d]: 'fire-fn-compat',\\r\\n    [name$c]: 'fire-iid',\\r\\n    [name$b]: 'fire-iid-compat',\\r\\n    [name$a]: 'fire-fcm',\\r\\n    [name$9]: 'fire-fcm-compat',\\r\\n    [name$8]: 'fire-perf',\\r\\n    [name$7]: 'fire-perf-compat',\\r\\n    [name$6]: 'fire-rc',\\r\\n    [name$5]: 'fire-rc-compat',\\r\\n    [name$4]: 'fire-gcs',\\r\\n    [name$3]: 'fire-gcs-compat',\\r\\n    [name$2]: 'fire-fst',\\r\\n    [name$1]: 'fire-fst-compat',\\r\\n    'fire-js': 'fire-js',\\r\\n    [name]: 'fire-js-all'\\r\\n};\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * @internal\\r\\n */\\r\\nconst _apps = new Map();\\r\\n/**\\r\\n * Registered components.\\r\\n *\\r\\n * @internal\\r\\n */\\r\\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\nconst _components = new Map();\\r\\n/**\\r\\n * @param component - the component being added to this app's container\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addComponent(app, component) {\\r\\n    try {\\r\\n        app.container.addComponent(component);\\r\\n    }\\r\\n    catch (e) {\\r\\n        logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\\r\\n    }\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _addOrOverwriteComponent(app, component) {\\r\\n    app.container.addOrOverwriteComponent(component);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param component - the component to register\\r\\n * @returns whether or not the component is registered successfully\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _registerComponent(component) {\\r\\n    const componentName = component.name;\\r\\n    if (_components.has(componentName)) {\\r\\n        logger.debug(`There were multiple attempts to register component ${componentName}.`);\\r\\n        return false;\\r\\n    }\\r\\n    _components.set(componentName, component);\\r\\n    // add the component to existing app instances\\r\\n    for (const app of _apps.values()) {\\r\\n        _addComponent(app, component);\\r\\n    }\\r\\n    return true;\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n *\\r\\n * @returns the provider for the service with the matching name\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _getProvider(app, name) {\\r\\n    const heartbeatController = app.container\\r\\n        .getProvider('heartbeat')\\r\\n        .getImmediate({ optional: true });\\r\\n    if (heartbeatController) {\\r\\n        void heartbeatController.triggerHeartbeat();\\r\\n    }\\r\\n    return app.container.getProvider(name);\\r\\n}\\r\\n/**\\r\\n *\\r\\n * @param app - FirebaseApp instance\\r\\n * @param name - service name\\r\\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\\r\\n    _getProvider(app, name).clearInstance(instanceIdentifier);\\r\\n}\\r\\n/**\\r\\n * Test only\\r\\n *\\r\\n * @internal\\r\\n */\\r\\nfunction _clearComponents() {\\r\\n    _components.clear();\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst ERRORS = {\\r\\n    [\\\"no-app\\\" /* NO_APP */]: \\\"No Firebase App '{$appName}' has been created - \\\" +\\r\\n        'call Firebase App.initializeApp()',\\r\\n    [\\\"bad-app-name\\\" /* BAD_APP_NAME */]: \\\"Illegal App name: '{$appName}\\\",\\r\\n    [\\\"duplicate-app\\\" /* DUPLICATE_APP */]: \\\"Firebase App named '{$appName}' already exists with different options or config\\\",\\r\\n    [\\\"app-deleted\\\" /* APP_DELETED */]: \\\"Firebase App named '{$appName}' already deleted\\\",\\r\\n    [\\\"invalid-app-argument\\\" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\\r\\n        'Firebase App instance.',\\r\\n    [\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\\r\\n    [\\\"storage-open\\\" /* STORAGE_OPEN */]: 'Error thrown when opening storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-get\\\" /* STORAGE_GET */]: 'Error thrown when reading from storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-set\\\" /* STORAGE_WRITE */]: 'Error thrown when writing to storage. Original error: {$originalErrorMessage}.',\\r\\n    [\\\"storage-delete\\\" /* STORAGE_DELETE */]: 'Error thrown when deleting from storage. Original error: {$originalErrorMessage}.'\\r\\n};\\r\\nconst ERROR_FACTORY = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__.ErrorFactory('app', 'Firebase', ERRORS);\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nclass FirebaseAppImpl {\\r\\n    constructor(options, config, container) {\\r\\n        this._isDeleted = false;\\r\\n        this._options = Object.assign({}, options);\\r\\n        this._config = Object.assign({}, config);\\r\\n        this._name = config.name;\\r\\n        this._automaticDataCollectionEnabled =\\r\\n            config.automaticDataCollectionEnabled;\\r\\n        this._container = container;\\r\\n        this.container.addComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('app', () => this, \\\"PUBLIC\\\" /* PUBLIC */));\\r\\n    }\\r\\n    get automaticDataCollectionEnabled() {\\r\\n        this.checkDestroyed();\\r\\n        return this._automaticDataCollectionEnabled;\\r\\n    }\\r\\n    set automaticDataCollectionEnabled(val) {\\r\\n        this.checkDestroyed();\\r\\n        this._automaticDataCollectionEnabled = val;\\r\\n    }\\r\\n    get name() {\\r\\n        this.checkDestroyed();\\r\\n        return this._name;\\r\\n    }\\r\\n    get options() {\\r\\n        this.checkDestroyed();\\r\\n        return this._options;\\r\\n    }\\r\\n    get config() {\\r\\n        this.checkDestroyed();\\r\\n        return this._config;\\r\\n    }\\r\\n    get container() {\\r\\n        return this._container;\\r\\n    }\\r\\n    get isDeleted() {\\r\\n        return this._isDeleted;\\r\\n    }\\r\\n    set isDeleted(val) {\\r\\n        this._isDeleted = val;\\r\\n    }\\r\\n    /**\\r\\n     * This function will throw an Error if the App has already been deleted -\\r\\n     * use before performing API actions on the App.\\r\\n     */\\r\\n    checkDestroyed() {\\r\\n        if (this.isDeleted) {\\r\\n            throw ERROR_FACTORY.create(\\\"app-deleted\\\" /* APP_DELETED */, { appName: this._name });\\r\\n        }\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * The current SDK version.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nconst SDK_VERSION = version;\\r\\nfunction initializeApp(options, rawConfig = {}) {\\r\\n    if (typeof rawConfig !== 'object') {\\r\\n        const name = rawConfig;\\r\\n        rawConfig = { name };\\r\\n    }\\r\\n    const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\\r\\n    const name = config.name;\\r\\n    if (typeof name !== 'string' || !name) {\\r\\n        throw ERROR_FACTORY.create(\\\"bad-app-name\\\" /* BAD_APP_NAME */, {\\r\\n            appName: String(name)\\r\\n        });\\r\\n    }\\r\\n    const existingApp = _apps.get(name);\\r\\n    if (existingApp) {\\r\\n        // return the existing app if options and config deep equal the ones in the existing app.\\r\\n        if ((0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(options, existingApp.options) &&\\r\\n            (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.deepEqual)(config, existingApp.config)) {\\r\\n            return existingApp;\\r\\n        }\\r\\n        else {\\r\\n            throw ERROR_FACTORY.create(\\\"duplicate-app\\\" /* DUPLICATE_APP */, { appName: name });\\r\\n        }\\r\\n    }\\r\\n    const container = new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.ComponentContainer(name);\\r\\n    for (const component of _components.values()) {\\r\\n        container.addComponent(component);\\r\\n    }\\r\\n    const newApp = new FirebaseAppImpl(options, config, container);\\r\\n    _apps.set(name, newApp);\\r\\n    return newApp;\\r\\n}\\r\\n/**\\r\\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\\r\\n *\\r\\n * When called with no arguments, the default app is returned. When an app name\\r\\n * is provided, the app corresponding to that name is returned.\\r\\n *\\r\\n * An exception is thrown if the app being retrieved has not yet been\\r\\n * initialized.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return the default app\\r\\n * const app = getApp();\\r\\n * ```\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * // Return a named app\\r\\n * const otherApp = getApp(\\\"otherApp\\\");\\r\\n * ```\\r\\n *\\r\\n * @param name - Optional name of the app to return. If no name is\\r\\n *   provided, the default is `\\\"[DEFAULT]\\\"`.\\r\\n *\\r\\n * @returns The app corresponding to the provided app name.\\r\\n *   If no app name is provided, the default app is returned.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\\r\\n    const app = _apps.get(name);\\r\\n    if (!app) {\\r\\n        throw ERROR_FACTORY.create(\\\"no-app\\\" /* NO_APP */, { appName: name });\\r\\n    }\\r\\n    return app;\\r\\n}\\r\\n/**\\r\\n * A (read-only) array of all initialized apps.\\r\\n * @public\\r\\n */\\r\\nfunction getApps() {\\r\\n    return Array.from(_apps.values());\\r\\n}\\r\\n/**\\r\\n * Renders this app unusable and frees the resources of all associated\\r\\n * services.\\r\\n *\\r\\n * @example\\r\\n * ```javascript\\r\\n * deleteApp(app)\\r\\n *   .then(function() {\\r\\n *     console.log(\\\"App deleted successfully\\\");\\r\\n *   })\\r\\n *   .catch(function(error) {\\r\\n *     console.log(\\\"Error deleting app:\\\", error);\\r\\n *   });\\r\\n * ```\\r\\n *\\r\\n * @public\\r\\n */\\r\\nasync function deleteApp(app) {\\r\\n    const name = app.name;\\r\\n    if (_apps.has(name)) {\\r\\n        _apps.delete(name);\\r\\n        await Promise.all(app.container\\r\\n            .getProviders()\\r\\n            .map(provider => provider.delete()));\\r\\n        app.isDeleted = true;\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Registers a library's name and version for platform logging purposes.\\r\\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\\r\\n * @param version - Current version of that library.\\r\\n * @param variant - Bundle variant, e.g., node, rn, etc.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction registerVersion(libraryKeyOrName, version, variant) {\\r\\n    var _a;\\r\\n    // TODO: We can use this check to whitelist strings when/if we set up\\r\\n    // a good whitelist system.\\r\\n    let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\\r\\n    if (variant) {\\r\\n        library += `-${variant}`;\\r\\n    }\\r\\n    const libraryMismatch = library.match(/\\\\s|\\\\//);\\r\\n    const versionMismatch = version.match(/\\\\s|\\\\//);\\r\\n    if (libraryMismatch || versionMismatch) {\\r\\n        const warning = [\\r\\n            `Unable to register library \\\"${library}\\\" with version \\\"${version}\\\":`\\r\\n        ];\\r\\n        if (libraryMismatch) {\\r\\n            warning.push(`library name \\\"${library}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        if (libraryMismatch && versionMismatch) {\\r\\n            warning.push('and');\\r\\n        }\\r\\n        if (versionMismatch) {\\r\\n            warning.push(`version name \\\"${version}\\\" contains illegal characters (whitespace or \\\"/\\\")`);\\r\\n        }\\r\\n        logger.warn(warning.join(' '));\\r\\n        return;\\r\\n    }\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component(`${library}-version`, () => ({ library, version }), \\\"VERSION\\\" /* VERSION */));\\r\\n}\\r\\n/**\\r\\n * Sets log handler for all Firebase SDKs.\\r\\n * @param logCallback - An optional custom log handler that executes user code whenever\\r\\n * the Firebase SDK makes a logging call.\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction onLog(logCallback, options) {\\r\\n    if (logCallback !== null && typeof logCallback !== 'function') {\\r\\n        throw ERROR_FACTORY.create(\\\"invalid-log-argument\\\" /* INVALID_LOG_ARGUMENT */);\\r\\n    }\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setUserLogHandler)(logCallback, options);\\r\\n}\\r\\n/**\\r\\n * Sets log level for all Firebase SDKs.\\r\\n *\\r\\n * All of the log types above the current log level are captured (i.e. if\\r\\n * you set the log level to `info`, errors are logged, but `debug` and\\r\\n * `verbose` logs are not).\\r\\n *\\r\\n * @public\\r\\n */\\r\\nfunction setLogLevel(logLevel) {\\r\\n    (0,_firebase_logger__WEBPACK_IMPORTED_MODULE_1__.setLogLevel)(logLevel);\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DB_NAME = 'firebase-heartbeat-database';\\r\\nconst DB_VERSION = 1;\\r\\nconst STORE_NAME = 'firebase-heartbeat-store';\\r\\nlet dbPromise = null;\\r\\nfunction getDbPromise() {\\r\\n    if (!dbPromise) {\\r\\n        dbPromise = (0,idb__WEBPACK_IMPORTED_MODULE_3__.openDB)(DB_NAME, DB_VERSION, {\\r\\n            upgrade: (db, oldVersion) => {\\r\\n                // We don't use 'break' in this switch statement, the fall-through\\r\\n                // behavior is what we want, because if there are multiple versions between\\r\\n                // the old version and the current version, we want ALL the migrations\\r\\n                // that correspond to those versions to run, not only the last one.\\r\\n                // eslint-disable-next-line default-case\\r\\n                switch (oldVersion) {\\r\\n                    case 0:\\r\\n                        db.createObjectStore(STORE_NAME);\\r\\n                }\\r\\n            }\\r\\n        }).catch(e => {\\r\\n            throw ERROR_FACTORY.create(\\\"storage-open\\\" /* STORAGE_OPEN */, {\\r\\n                originalErrorMessage: e.message\\r\\n            });\\r\\n        });\\r\\n    }\\r\\n    return dbPromise;\\r\\n}\\r\\nasync function readHeartbeatsFromIndexedDB(app) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        return db\\r\\n            .transaction(STORE_NAME)\\r\\n            .objectStore(STORE_NAME)\\r\\n            .get(computeKey(app));\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-get\\\" /* STORAGE_GET */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\\r\\n    try {\\r\\n        const db = await getDbPromise();\\r\\n        const tx = db.transaction(STORE_NAME, 'readwrite');\\r\\n        const objectStore = tx.objectStore(STORE_NAME);\\r\\n        await objectStore.put(heartbeatObject, computeKey(app));\\r\\n        return tx.done;\\r\\n    }\\r\\n    catch (e) {\\r\\n        throw ERROR_FACTORY.create(\\\"storage-set\\\" /* STORAGE_WRITE */, {\\r\\n            originalErrorMessage: e.message\\r\\n        });\\r\\n    }\\r\\n}\\r\\nfunction computeKey(app) {\\r\\n    return `${app.name}!${app.options.appId}`;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2021 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst MAX_HEADER_BYTES = 1024;\\r\\n// 30 days\\r\\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\\r\\nclass HeartbeatServiceImpl {\\r\\n    constructor(container) {\\r\\n        this.container = container;\\r\\n        /**\\r\\n         * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\\r\\n         * the header string.\\r\\n         * Stores one record per date. This will be consolidated into the standard\\r\\n         * format of one record per user agent string before being sent as a header.\\r\\n         * Populated from indexedDB when the controller is instantiated and should\\r\\n         * be kept in sync with indexedDB.\\r\\n         * Leave public for easier testing.\\r\\n         */\\r\\n        this._heartbeatsCache = null;\\r\\n        const app = this.container.getProvider('app').getImmediate();\\r\\n        this._storage = new HeartbeatStorageImpl(app);\\r\\n        this._heartbeatsCachePromise = this._storage.read().then(result => {\\r\\n            this._heartbeatsCache = result;\\r\\n            return result;\\r\\n        });\\r\\n    }\\r\\n    /**\\r\\n     * Called to report a heartbeat. The function will generate\\r\\n     * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\\r\\n     * to IndexedDB.\\r\\n     * Note that we only store one heartbeat per day. So if a heartbeat for today is\\r\\n     * already logged, subsequent calls to this function in the same day will be ignored.\\r\\n     */\\r\\n    async triggerHeartbeat() {\\r\\n        const platformLogger = this.container\\r\\n            .getProvider('platform-logger')\\r\\n            .getImmediate();\\r\\n        // This is the \\\"Firebase user agent\\\" string from the platform logger\\r\\n        // service, not the browser user agent.\\r\\n        const agent = platformLogger.getPlatformInfoString();\\r\\n        const date = getUTCDateString();\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            this._heartbeatsCache = await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // Do not store a heartbeat if one is already stored for this day\\r\\n        // or if a header has already been sent today.\\r\\n        if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\\r\\n            this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            // There is no entry for this date. Create one.\\r\\n            this._heartbeatsCache.heartbeats.push({ date, agent });\\r\\n        }\\r\\n        // Remove entries older than 30 days.\\r\\n        this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\\r\\n            const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\\r\\n            const now = Date.now();\\r\\n            return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\\r\\n        });\\r\\n        return this._storage.overwrite(this._heartbeatsCache);\\r\\n    }\\r\\n    /**\\r\\n     * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\\r\\n     * It also clears all heartbeats from memory as well as in IndexedDB.\\r\\n     *\\r\\n     * NOTE: Consuming product SDKs should not send the header if this method\\r\\n     * returns an empty string.\\r\\n     */\\r\\n    async getHeartbeatsHeader() {\\r\\n        if (this._heartbeatsCache === null) {\\r\\n            await this._heartbeatsCachePromise;\\r\\n        }\\r\\n        // If it's still null or the array is empty, there is no data to send.\\r\\n        if (this._heartbeatsCache === null ||\\r\\n            this._heartbeatsCache.heartbeats.length === 0) {\\r\\n            return '';\\r\\n        }\\r\\n        const date = getUTCDateString();\\r\\n        // Extract as many heartbeats from the cache as will fit under the size limit.\\r\\n        const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\\r\\n        const headerString = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\\r\\n        // Store last sent date to prevent another being logged/sent for the same day.\\r\\n        this._heartbeatsCache.lastSentHeartbeatDate = date;\\r\\n        if (unsentEntries.length > 0) {\\r\\n            // Store any unsent entries if they exist.\\r\\n            this._heartbeatsCache.heartbeats = unsentEntries;\\r\\n            // This seems more likely than emptying the array (below) to lead to some odd state\\r\\n            // since the cache isn't empty and this will be called again on the next request,\\r\\n            // and is probably safest if we await it.\\r\\n            await this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        else {\\r\\n            this._heartbeatsCache.heartbeats = [];\\r\\n            // Do not wait for this, to reduce latency.\\r\\n            void this._storage.overwrite(this._heartbeatsCache);\\r\\n        }\\r\\n        return headerString;\\r\\n    }\\r\\n}\\r\\nfunction getUTCDateString() {\\r\\n    const today = new Date();\\r\\n    // Returns date format 'YYYY-MM-DD'\\r\\n    return today.toISOString().substring(0, 10);\\r\\n}\\r\\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\\r\\n    // Heartbeats grouped by user agent in the standard format to be sent in\\r\\n    // the header.\\r\\n    const heartbeatsToSend = [];\\r\\n    // Single date format heartbeats that are not sent.\\r\\n    let unsentEntries = heartbeatsCache.slice();\\r\\n    for (const singleDateHeartbeat of heartbeatsCache) {\\r\\n        // Look for an existing entry with the same user agent.\\r\\n        const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\\r\\n        if (!heartbeatEntry) {\\r\\n            // If no entry for this user agent exists, create one.\\r\\n            heartbeatsToSend.push({\\r\\n                agent: singleDateHeartbeat.agent,\\r\\n                dates: [singleDateHeartbeat.date]\\r\\n            });\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                // If the header would exceed max size, remove the added heartbeat\\r\\n                // entry and stop adding to the header.\\r\\n                heartbeatsToSend.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            heartbeatEntry.dates.push(singleDateHeartbeat.date);\\r\\n            // If the header would exceed max size, remove the added date\\r\\n            // and stop adding to the header.\\r\\n            if (countBytes(heartbeatsToSend) > maxSize) {\\r\\n                heartbeatEntry.dates.pop();\\r\\n                break;\\r\\n            }\\r\\n        }\\r\\n        // Pop unsent entry from queue. (Skipped if adding the entry exceeded\\r\\n        // quota and the loop breaks early.)\\r\\n        unsentEntries = unsentEntries.slice(1);\\r\\n    }\\r\\n    return {\\r\\n        heartbeatsToSend,\\r\\n        unsentEntries\\r\\n    };\\r\\n}\\r\\nclass HeartbeatStorageImpl {\\r\\n    constructor(app) {\\r\\n        this.app = app;\\r\\n        this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\\r\\n    }\\r\\n    async runIndexedDBEnvironmentCheck() {\\r\\n        if (!(0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.isIndexedDBAvailable)()) {\\r\\n            return false;\\r\\n        }\\r\\n        else {\\r\\n            return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.validateIndexedDBOpenable)()\\r\\n                .then(() => true)\\r\\n                .catch(() => false);\\r\\n        }\\r\\n    }\\r\\n    /**\\r\\n     * Read all heartbeats.\\r\\n     */\\r\\n    async read() {\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return { heartbeats: [] };\\r\\n        }\\r\\n        else {\\r\\n            const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\\r\\n            return idbHeartbeatObject || { heartbeats: [] };\\r\\n        }\\r\\n    }\\r\\n    // overwrite the storage with the provided heartbeats\\r\\n    async overwrite(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: heartbeatsObject.heartbeats\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n    // add heartbeats\\r\\n    async add(heartbeatsObject) {\\r\\n        var _a;\\r\\n        const canUseIndexedDB = await this._canUseIndexedDBPromise;\\r\\n        if (!canUseIndexedDB) {\\r\\n            return;\\r\\n        }\\r\\n        else {\\r\\n            const existingHeartbeatsObject = await this.read();\\r\\n            return writeHeartbeatsToIndexedDB(this.app, {\\r\\n                lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\\r\\n                heartbeats: [\\r\\n                    ...existingHeartbeatsObject.heartbeats,\\r\\n                    ...heartbeatsObject.heartbeats\\r\\n                ]\\r\\n            });\\r\\n        }\\r\\n    }\\r\\n}\\r\\n/**\\r\\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\\r\\n * in a platform logging header JSON object, stringified, and converted\\r\\n * to base 64.\\r\\n */\\r\\nfunction countBytes(heartbeatsCache) {\\r\\n    // base64 has a restricted set of characters, all of which should be 1 byte.\\r\\n    return (0,_firebase_util__WEBPACK_IMPORTED_MODULE_2__.base64urlEncodeWithoutPadding)(\\r\\n    // heartbeatsCache wrapper properties\\r\\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nfunction registerCoreComponents(variant) {\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    _registerComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_0__.Component('heartbeat', container => new HeartbeatServiceImpl(container), \\\"PRIVATE\\\" /* PRIVATE */));\\r\\n    // Register `app` package.\\r\\n    registerVersion(name$o, version$1, variant);\\r\\n    // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\\r\\n    registerVersion(name$o, version$1, 'esm2017');\\r\\n    // Register platform SDK identifier (no version).\\r\\n    registerVersion('fire-js', '');\\r\\n}\\n\\n/**\\r\\n * Firebase App\\r\\n *\\r\\n * @remarks This package coordinates the communication between the different Firebase components\\r\\n * @packageDocumentation\\r\\n */\\r\\nregisterCoreComponents('');\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/app/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/component/dist/esm/index.esm2017.js\":\n/*!********************************************************************!*\\\n  !*** ./node_modules/@firebase/component/dist/esm/index.esm2017.js ***!\n  \\********************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"Component\\\": () => (/* binding */ Component),\\n/* harmony export */   \\\"ComponentContainer\\\": () => (/* binding */ ComponentContainer),\\n/* harmony export */   \\\"Provider\\\": () => (/* binding */ Provider)\\n/* harmony export */ });\\n/* harmony import */ var _firebase_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @firebase/util */ \\\"./node_modules/@firebase/util/dist/index.esm2017.js\\\");\\n\\n\\n/**\\r\\n * Component for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass Component {\\r\\n    /**\\r\\n     *\\r\\n     * @param name The public service name, e.g. app, auth, firestore, database\\r\\n     * @param instanceFactory Service factory responsible for creating the public interface\\r\\n     * @param type whether the service provided by the component is public or private\\r\\n     */\\r\\n    constructor(name, instanceFactory, type) {\\r\\n        this.name = name;\\r\\n        this.instanceFactory = instanceFactory;\\r\\n        this.type = type;\\r\\n        this.multipleInstances = false;\\r\\n        /**\\r\\n         * Properties to be added to the service namespace\\r\\n         */\\r\\n        this.serviceProps = {};\\r\\n        this.instantiationMode = \\\"LAZY\\\" /* LAZY */;\\r\\n        this.onInstanceCreated = null;\\r\\n    }\\r\\n    setInstantiationMode(mode) {\\r\\n        this.instantiationMode = mode;\\r\\n        return this;\\r\\n    }\\r\\n    setMultipleInstances(multipleInstances) {\\r\\n        this.multipleInstances = multipleInstances;\\r\\n        return this;\\r\\n    }\\r\\n    setServiceProps(props) {\\r\\n        this.serviceProps = props;\\r\\n        return this;\\r\\n    }\\r\\n    setInstanceCreatedCallback(callback) {\\r\\n        this.onInstanceCreated = callback;\\r\\n        return this;\\r\\n    }\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\\r\\n * NameServiceMapping[T] is an alias for the type of the instance\\r\\n */\\r\\nclass Provider {\\r\\n    constructor(name, container) {\\r\\n        this.name = name;\\r\\n        this.container = container;\\r\\n        this.component = null;\\r\\n        this.instances = new Map();\\r\\n        this.instancesDeferred = new Map();\\r\\n        this.instancesOptions = new Map();\\r\\n        this.onInitCallbacks = new Map();\\r\\n    }\\r\\n    /**\\r\\n     * @param identifier A provider can provide mulitple instances of a service\\r\\n     * if this.component.multipleInstances is true.\\r\\n     */\\r\\n    get(identifier) {\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        if (!this.instancesDeferred.has(normalizedIdentifier)) {\\r\\n            const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_0__.Deferred();\\r\\n            this.instancesDeferred.set(normalizedIdentifier, deferred);\\r\\n            if (this.isInitialized(normalizedIdentifier) ||\\r\\n                this.shouldAutoInitialize()) {\\r\\n                // initialize the service if it can be auto-initialized\\r\\n                try {\\r\\n                    const instance = this.getOrInitializeService({\\r\\n                        instanceIdentifier: normalizedIdentifier\\r\\n                    });\\r\\n                    if (instance) {\\r\\n                        deferred.resolve(instance);\\r\\n                    }\\r\\n                }\\r\\n                catch (e) {\\r\\n                    // when the instance factory throws an exception during get(), it should not cause\\r\\n                    // a fatal error. We just return the unresolved promise in this case.\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return this.instancesDeferred.get(normalizedIdentifier).promise;\\r\\n    }\\r\\n    getImmediate(options) {\\r\\n        var _a;\\r\\n        // if multipleInstances is not supported, use the default name\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\\r\\n        const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\\r\\n        if (this.isInitialized(normalizedIdentifier) ||\\r\\n            this.shouldAutoInitialize()) {\\r\\n            try {\\r\\n                return this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n            }\\r\\n            catch (e) {\\r\\n                if (optional) {\\r\\n                    return null;\\r\\n                }\\r\\n                else {\\r\\n                    throw e;\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        else {\\r\\n            // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\\r\\n            if (optional) {\\r\\n                return null;\\r\\n            }\\r\\n            else {\\r\\n                throw Error(`Service ${this.name} is not available`);\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getComponent() {\\r\\n        return this.component;\\r\\n    }\\r\\n    setComponent(component) {\\r\\n        if (component.name !== this.name) {\\r\\n            throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\\r\\n        }\\r\\n        if (this.component) {\\r\\n            throw Error(`Component for ${this.name} has already been provided`);\\r\\n        }\\r\\n        this.component = component;\\r\\n        // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\\r\\n        if (!this.shouldAutoInitialize()) {\\r\\n            return;\\r\\n        }\\r\\n        // if the service is eager, initialize the default instance\\r\\n        if (isComponentEager(component)) {\\r\\n            try {\\r\\n                this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory for an eager Component throws an exception during the eager\\r\\n                // initialization, it should not cause a fatal error.\\r\\n                // TODO: Investigate if we need to make it configurable, because some component may want to cause\\r\\n                // a fatal error in this case?\\r\\n            }\\r\\n        }\\r\\n        // Create service instances for the pending promises and resolve them\\r\\n        // NOTE: if this.multipleInstances is false, only the default instance will be created\\r\\n        // and all promises with resolve with it regardless of the identifier.\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            try {\\r\\n                // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\\r\\n                const instance = this.getOrInitializeService({\\r\\n                    instanceIdentifier: normalizedIdentifier\\r\\n                });\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n            catch (e) {\\r\\n                // when the instance factory throws an exception, it should not cause\\r\\n                // a fatal error. We just leave the promise unresolved.\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    clearInstance(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        this.instancesDeferred.delete(identifier);\\r\\n        this.instancesOptions.delete(identifier);\\r\\n        this.instances.delete(identifier);\\r\\n    }\\r\\n    // app.delete() will call this method on every provider to delete the services\\r\\n    // TODO: should we mark the provider as deleted?\\r\\n    async delete() {\\r\\n        const services = Array.from(this.instances.values());\\r\\n        await Promise.all([\\r\\n            ...services\\r\\n                .filter(service => 'INTERNAL' in service) // legacy services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service.INTERNAL.delete()),\\r\\n            ...services\\r\\n                .filter(service => '_delete' in service) // modularized services\\r\\n                // eslint-disable-next-line @typescript-eslint/no-explicit-any\\r\\n                .map(service => service._delete())\\r\\n        ]);\\r\\n    }\\r\\n    isComponentSet() {\\r\\n        return this.component != null;\\r\\n    }\\r\\n    isInitialized(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instances.has(identifier);\\r\\n    }\\r\\n    getOptions(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        return this.instancesOptions.get(identifier) || {};\\r\\n    }\\r\\n    initialize(opts = {}) {\\r\\n        const { options = {} } = opts;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\\r\\n        if (this.isInitialized(normalizedIdentifier)) {\\r\\n            throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\\r\\n        }\\r\\n        if (!this.isComponentSet()) {\\r\\n            throw Error(`Component ${this.name} has not been registered yet`);\\r\\n        }\\r\\n        const instance = this.getOrInitializeService({\\r\\n            instanceIdentifier: normalizedIdentifier,\\r\\n            options\\r\\n        });\\r\\n        // resolve any pending promise waiting for the service instance\\r\\n        for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\\r\\n            const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\\r\\n            if (normalizedIdentifier === normalizedDeferredIdentifier) {\\r\\n                instanceDeferred.resolve(instance);\\r\\n            }\\r\\n        }\\r\\n        return instance;\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\\r\\n     * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\\r\\n     *\\r\\n     * @param identifier An optional instance identifier\\r\\n     * @returns a function to unregister the callback\\r\\n     */\\r\\n    onInit(callback, identifier) {\\r\\n        var _a;\\r\\n        const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\\r\\n        const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\\r\\n        existingCallbacks.add(callback);\\r\\n        this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\\r\\n        const existingInstance = this.instances.get(normalizedIdentifier);\\r\\n        if (existingInstance) {\\r\\n            callback(existingInstance, normalizedIdentifier);\\r\\n        }\\r\\n        return () => {\\r\\n            existingCallbacks.delete(callback);\\r\\n        };\\r\\n    }\\r\\n    /**\\r\\n     * Invoke onInit callbacks synchronously\\r\\n     * @param instance the service instance`\\r\\n     */\\r\\n    invokeOnInitCallbacks(instance, identifier) {\\r\\n        const callbacks = this.onInitCallbacks.get(identifier);\\r\\n        if (!callbacks) {\\r\\n            return;\\r\\n        }\\r\\n        for (const callback of callbacks) {\\r\\n            try {\\r\\n                callback(instance, identifier);\\r\\n            }\\r\\n            catch (_a) {\\r\\n                // ignore errors in the onInit callback\\r\\n            }\\r\\n        }\\r\\n    }\\r\\n    getOrInitializeService({ instanceIdentifier, options = {} }) {\\r\\n        let instance = this.instances.get(instanceIdentifier);\\r\\n        if (!instance && this.component) {\\r\\n            instance = this.component.instanceFactory(this.container, {\\r\\n                instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\\r\\n                options\\r\\n            });\\r\\n            this.instances.set(instanceIdentifier, instance);\\r\\n            this.instancesOptions.set(instanceIdentifier, options);\\r\\n            /**\\r\\n             * Invoke onInit listeners.\\r\\n             * Note this.component.onInstanceCreated is different, which is used by the component creator,\\r\\n             * while onInit listeners are registered by consumers of the provider.\\r\\n             */\\r\\n            this.invokeOnInitCallbacks(instance, instanceIdentifier);\\r\\n            /**\\r\\n             * Order is important\\r\\n             * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\\r\\n             * makes `isInitialized()` return true.\\r\\n             */\\r\\n            if (this.component.onInstanceCreated) {\\r\\n                try {\\r\\n                    this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\\r\\n                }\\r\\n                catch (_a) {\\r\\n                    // ignore errors in the onInstanceCreatedCallback\\r\\n                }\\r\\n            }\\r\\n        }\\r\\n        return instance || null;\\r\\n    }\\r\\n    normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\\r\\n        if (this.component) {\\r\\n            return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\\r\\n        }\\r\\n        else {\\r\\n            return identifier; // assume multiple instances are supported before the component is provided.\\r\\n        }\\r\\n    }\\r\\n    shouldAutoInitialize() {\\r\\n        return (!!this.component &&\\r\\n            this.component.instantiationMode !== \\\"EXPLICIT\\\" /* EXPLICIT */);\\r\\n    }\\r\\n}\\r\\n// undefined should be passed to the service factory for the default instance\\r\\nfunction normalizeIdentifierForFactory(identifier) {\\r\\n    return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\\r\\n}\\r\\nfunction isComponentEager(component) {\\r\\n    return component.instantiationMode === \\\"EAGER\\\" /* EAGER */;\\r\\n}\\n\\n/**\\r\\n * @license\\r\\n * Copyright 2019 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\\r\\n */\\r\\nclass ComponentContainer {\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        this.providers = new Map();\\r\\n    }\\r\\n    /**\\r\\n     *\\r\\n     * @param component Component being added\\r\\n     * @param overwrite When a component with the same name has already been registered,\\r\\n     * if overwrite is true: overwrite the existing component with the new component and create a new\\r\\n     * provider with the new component. It can be useful in tests where you want to use different mocks\\r\\n     * for different tests.\\r\\n     * if overwrite is false: throw an exception\\r\\n     */\\r\\n    addComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\\r\\n        }\\r\\n        provider.setComponent(component);\\r\\n    }\\r\\n    addOrOverwriteComponent(component) {\\r\\n        const provider = this.getProvider(component.name);\\r\\n        if (provider.isComponentSet()) {\\r\\n            // delete the existing provider from the container, so we can register the new component\\r\\n            this.providers.delete(component.name);\\r\\n        }\\r\\n        this.addComponent(component);\\r\\n    }\\r\\n    /**\\r\\n     * getProvider provides a type safe interface where it can only be called with a field name\\r\\n     * present in NameServiceMapping interface.\\r\\n     *\\r\\n     * Firebase SDKs providing services should extend NameServiceMapping interface to register\\r\\n     * themselves.\\r\\n     */\\r\\n    getProvider(name) {\\r\\n        if (this.providers.has(name)) {\\r\\n            return this.providers.get(name);\\r\\n        }\\r\\n        // create a Provider for a service that hasn't registered with Firebase\\r\\n        const provider = new Provider(name, this);\\r\\n        this.providers.set(name, provider);\\r\\n        return provider;\\r\\n    }\\r\\n    getProviders() {\\r\\n        return Array.from(this.providers.values());\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/component/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/@firebase/logger/dist/esm/index.esm2017.js\":\n/*!*****************************************************************!*\\\n  !*** ./node_modules/@firebase/logger/dist/esm/index.esm2017.js ***!\n  \\*****************************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"LogLevel\\\": () => (/* binding */ LogLevel),\\n/* harmony export */   \\\"Logger\\\": () => (/* binding */ Logger),\\n/* harmony export */   \\\"setLogLevel\\\": () => (/* binding */ setLogLevel),\\n/* harmony export */   \\\"setUserLogHandler\\\": () => (/* binding */ setUserLogHandler)\\n/* harmony export */ });\\n/**\\r\\n * @license\\r\\n * Copyright 2017 Google LLC\\r\\n *\\r\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\r\\n * you may not use this file except in compliance with the License.\\r\\n * You may obtain a copy of the License at\\r\\n *\\r\\n *   http://www.apache.org/licenses/LICENSE-2.0\\r\\n *\\r\\n * Unless required by applicable law or agreed to in writing, software\\r\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\r\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\r\\n * See the License for the specific language governing permissions and\\r\\n * limitations under the License.\\r\\n */\\r\\n/**\\r\\n * A container for all of the Logger instances\\r\\n */\\r\\nconst instances = [];\\r\\n/**\\r\\n * The JS SDK supports 5 log levels and also allows a user the ability to\\r\\n * silence the logs altogether.\\r\\n *\\r\\n * The order is a follows:\\r\\n * DEBUG < VERBOSE < INFO < WARN < ERROR\\r\\n *\\r\\n * All of the log types above the current log level will be captured (i.e. if\\r\\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\\r\\n * `VERBOSE` logs will not)\\r\\n */\\r\\nvar LogLevel;\\r\\n(function (LogLevel) {\\r\\n    LogLevel[LogLevel[\\\"DEBUG\\\"] = 0] = \\\"DEBUG\\\";\\r\\n    LogLevel[LogLevel[\\\"VERBOSE\\\"] = 1] = \\\"VERBOSE\\\";\\r\\n    LogLevel[LogLevel[\\\"INFO\\\"] = 2] = \\\"INFO\\\";\\r\\n    LogLevel[LogLevel[\\\"WARN\\\"] = 3] = \\\"WARN\\\";\\r\\n    LogLevel[LogLevel[\\\"ERROR\\\"] = 4] = \\\"ERROR\\\";\\r\\n    LogLevel[LogLevel[\\\"SILENT\\\"] = 5] = \\\"SILENT\\\";\\r\\n})(LogLevel || (LogLevel = {}));\\r\\nconst levelStringToEnum = {\\r\\n    'debug': LogLevel.DEBUG,\\r\\n    'verbose': LogLevel.VERBOSE,\\r\\n    'info': LogLevel.INFO,\\r\\n    'warn': LogLevel.WARN,\\r\\n    'error': LogLevel.ERROR,\\r\\n    'silent': LogLevel.SILENT\\r\\n};\\r\\n/**\\r\\n * The default log level\\r\\n */\\r\\nconst defaultLogLevel = LogLevel.INFO;\\r\\n/**\\r\\n * By default, `console.debug` is not displayed in the developer console (in\\r\\n * chrome). To avoid forcing users to have to opt-in to these logs twice\\r\\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\\r\\n * logs to the `console.log` function.\\r\\n */\\r\\nconst ConsoleMethod = {\\r\\n    [LogLevel.DEBUG]: 'log',\\r\\n    [LogLevel.VERBOSE]: 'log',\\r\\n    [LogLevel.INFO]: 'info',\\r\\n    [LogLevel.WARN]: 'warn',\\r\\n    [LogLevel.ERROR]: 'error'\\r\\n};\\r\\n/**\\r\\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\\r\\n * messages on to their corresponding console counterparts (if the log method\\r\\n * is supported by the current log level)\\r\\n */\\r\\nconst defaultLogHandler = (instance, logType, ...args) => {\\r\\n    if (logType < instance.logLevel) {\\r\\n        return;\\r\\n    }\\r\\n    const now = new Date().toISOString();\\r\\n    const method = ConsoleMethod[logType];\\r\\n    if (method) {\\r\\n        console[method](`[${now}]  ${instance.name}:`, ...args);\\r\\n    }\\r\\n    else {\\r\\n        throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\\r\\n    }\\r\\n};\\r\\nclass Logger {\\r\\n    /**\\r\\n     * Gives you an instance of a Logger to capture messages according to\\r\\n     * Firebase's logging scheme.\\r\\n     *\\r\\n     * @param name The name that the logs will be associated with\\r\\n     */\\r\\n    constructor(name) {\\r\\n        this.name = name;\\r\\n        /**\\r\\n         * The log level of the given Logger instance.\\r\\n         */\\r\\n        this._logLevel = defaultLogLevel;\\r\\n        /**\\r\\n         * The main (internal) log handler for the Logger instance.\\r\\n         * Can be set to a new function in internal package code but not by user.\\r\\n         */\\r\\n        this._logHandler = defaultLogHandler;\\r\\n        /**\\r\\n         * The optional, additional, user-defined log handler for the Logger instance.\\r\\n         */\\r\\n        this._userLogHandler = null;\\r\\n        /**\\r\\n         * Capture the current instance for later use\\r\\n         */\\r\\n        instances.push(this);\\r\\n    }\\r\\n    get logLevel() {\\r\\n        return this._logLevel;\\r\\n    }\\r\\n    set logLevel(val) {\\r\\n        if (!(val in LogLevel)) {\\r\\n            throw new TypeError(`Invalid value \\\"${val}\\\" assigned to \\\\`logLevel\\\\``);\\r\\n        }\\r\\n        this._logLevel = val;\\r\\n    }\\r\\n    // Workaround for setter/getter having to be the same type.\\r\\n    setLogLevel(val) {\\r\\n        this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\\r\\n    }\\r\\n    get logHandler() {\\r\\n        return this._logHandler;\\r\\n    }\\r\\n    set logHandler(val) {\\r\\n        if (typeof val !== 'function') {\\r\\n            throw new TypeError('Value assigned to `logHandler` must be a function');\\r\\n        }\\r\\n        this._logHandler = val;\\r\\n    }\\r\\n    get userLogHandler() {\\r\\n        return this._userLogHandler;\\r\\n    }\\r\\n    set userLogHandler(val) {\\r\\n        this._userLogHandler = val;\\r\\n    }\\r\\n    /**\\r\\n     * The functions below are all based on the `console` interface\\r\\n     */\\r\\n    debug(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\\r\\n        this._logHandler(this, LogLevel.DEBUG, ...args);\\r\\n    }\\r\\n    log(...args) {\\r\\n        this._userLogHandler &&\\r\\n            this._userLogHandler(this, LogLevel.VERBOSE, ...args);\\r\\n        this._logHandler(this, LogLevel.VERBOSE, ...args);\\r\\n    }\\r\\n    info(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\\r\\n        this._logHandler(this, LogLevel.INFO, ...args);\\r\\n    }\\r\\n    warn(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\\r\\n        this._logHandler(this, LogLevel.WARN, ...args);\\r\\n    }\\r\\n    error(...args) {\\r\\n        this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\\r\\n        this._logHandler(this, LogLevel.ERROR, ...args);\\r\\n    }\\r\\n}\\r\\nfunction setLogLevel(level) {\\r\\n    instances.forEach(inst => {\\r\\n        inst.setLogLevel(level);\\r\\n    });\\r\\n}\\r\\nfunction setUserLogHandler(logCallback, options) {\\r\\n    for (const instance of instances) {\\r\\n        let customLogLevel = null;\\r\\n        if (options && options.level) {\\r\\n            customLogLevel = levelStringToEnum[options.level];\\r\\n        }\\r\\n        if (logCallback === null) {\\r\\n            instance.userLogHandler = null;\\r\\n        }\\r\\n        else {\\r\\n            instance.userLogHandler = (instance, level, ...args) => {\\r\\n                const message = args\\r\\n                    .map(arg => {\\r\\n                    if (arg == null) {\\r\\n                        return null;\\r\\n                    }\\r\\n                    else if (typeof arg === 'string') {\\r\\n                        return arg;\\r\\n                    }\\r\\n                    else if (typeof arg === 'number' || typeof arg === 'boolean') {\\r\\n                        return arg.toString();\\r\\n                    }\\r\\n                    else if (arg instanceof Error) {\\r\\n                        return arg.message;\\r\\n                    }\\r\\n                    else {\\r\\n                        try {\\r\\n                            return JSON.stringify(arg);\\r\\n                        }\\r\\n                        catch (ignored) {\\r\\n                            return null;\\r\\n                        }\\r\\n                    }\\r\\n                })\\r\\n                    .filter(arg => arg)\\r\\n                    .join(' ');\\r\\n                if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\\r\\n                    logCallback({\\r\\n                        level: LogLevel[level].toLowerCase(),\\r\\n                        message,\\r\\n                        args,\\r\\n                        type: instance.name\\r\\n                    });\\r\\n                }\\r\\n            };\\r\\n        }\\r\\n    }\\r\\n}\\n\\n\\n//# sourceMappingURL=index.esm2017.js.map\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/@firebase/logger/dist/esm/index.esm2017.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/index.js\":\n/*!*****************************************!*\\\n  !*** ./node_modules/idb/build/index.js ***!\n  \\*****************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"unwrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.u),\\n/* harmony export */   \\\"wrap\\\": () => (/* reexport safe */ _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w),\\n/* harmony export */   \\\"deleteDB\\\": () => (/* binding */ deleteDB),\\n/* harmony export */   \\\"openDB\\\": () => (/* binding */ openDB)\\n/* harmony export */ });\\n/* harmony import */ var _wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrap-idb-value.js */ \\\"./node_modules/idb/build/wrap-idb-value.js\\\");\\n\\n\\n\\n/**\\n * Open a database.\\n *\\n * @param name Name of the database.\\n * @param version Schema version.\\n * @param callbacks Additional callbacks.\\n */\\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\\n    const request = indexedDB.open(name, version);\\n    const openPromise = (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request);\\n    if (upgrade) {\\n        request.addEventListener('upgradeneeded', (event) => {\\n            upgrade((0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.result), event.oldVersion, event.newVersion, (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request.transaction));\\n        });\\n    }\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    openPromise\\n        .then((db) => {\\n        if (terminated)\\n            db.addEventListener('close', () => terminated());\\n        if (blocking)\\n            db.addEventListener('versionchange', () => blocking());\\n    })\\n        .catch(() => { });\\n    return openPromise;\\n}\\n/**\\n * Delete a database.\\n *\\n * @param name Name of the database.\\n */\\nfunction deleteDB(name, { blocked } = {}) {\\n    const request = indexedDB.deleteDatabase(name);\\n    if (blocked)\\n        request.addEventListener('blocked', () => blocked());\\n    return (0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.w)(request).then(() => undefined);\\n}\\n\\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\\nconst cachedMethods = new Map();\\nfunction getMethod(target, prop) {\\n    if (!(target instanceof IDBDatabase &&\\n        !(prop in target) &&\\n        typeof prop === 'string')) {\\n        return;\\n    }\\n    if (cachedMethods.get(prop))\\n        return cachedMethods.get(prop);\\n    const targetFuncName = prop.replace(/FromIndex$/, '');\\n    const useIndex = prop !== targetFuncName;\\n    const isWrite = writeMethods.includes(targetFuncName);\\n    if (\\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\\n        !(isWrite || readMethods.includes(targetFuncName))) {\\n        return;\\n    }\\n    const method = async function (storeName, ...args) {\\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\\n        let target = tx.store;\\n        if (useIndex)\\n            target = target.index(args.shift());\\n        // Must reject if op rejects.\\n        // If it's a write operation, must reject if tx.done rejects.\\n        // Must reject with op rejection first.\\n        // Must resolve with op value.\\n        // Must handle both promises (no unhandled rejections)\\n        return (await Promise.all([\\n            target[targetFuncName](...args),\\n            isWrite && tx.done,\\n        ]))[0];\\n    };\\n    cachedMethods.set(prop, method);\\n    return method;\\n}\\n(0,_wrap_idb_value_js__WEBPACK_IMPORTED_MODULE_0__.r)((oldTraps) => ({\\n    ...oldTraps,\\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\\n}));\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/index.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/idb/build/wrap-idb-value.js\":\n/*!**************************************************!*\\\n  !*** ./node_modules/idb/build/wrap-idb-value.js ***!\n  \\**************************************************/\n/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {\n\neval(\"__webpack_require__.r(__webpack_exports__);\\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\\n/* harmony export */   \\\"a\\\": () => (/* binding */ reverseTransformCache),\\n/* harmony export */   \\\"i\\\": () => (/* binding */ instanceOfAny),\\n/* harmony export */   \\\"r\\\": () => (/* binding */ replaceTraps),\\n/* harmony export */   \\\"u\\\": () => (/* binding */ unwrap),\\n/* harmony export */   \\\"w\\\": () => (/* binding */ wrap)\\n/* harmony export */ });\\nconst instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\\n\\nlet idbProxyableTypes;\\nlet cursorAdvanceMethods;\\n// This is a function to prevent it throwing up in node environments.\\nfunction getIdbProxyableTypes() {\\n    return (idbProxyableTypes ||\\n        (idbProxyableTypes = [\\n            IDBDatabase,\\n            IDBObjectStore,\\n            IDBIndex,\\n            IDBCursor,\\n            IDBTransaction,\\n        ]));\\n}\\n// This is a function to prevent it throwing up in node environments.\\nfunction getCursorAdvanceMethods() {\\n    return (cursorAdvanceMethods ||\\n        (cursorAdvanceMethods = [\\n            IDBCursor.prototype.advance,\\n            IDBCursor.prototype.continue,\\n            IDBCursor.prototype.continuePrimaryKey,\\n        ]));\\n}\\nconst cursorRequestMap = new WeakMap();\\nconst transactionDoneMap = new WeakMap();\\nconst transactionStoreNamesMap = new WeakMap();\\nconst transformCache = new WeakMap();\\nconst reverseTransformCache = new WeakMap();\\nfunction promisifyRequest(request) {\\n    const promise = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            request.removeEventListener('success', success);\\n            request.removeEventListener('error', error);\\n        };\\n        const success = () => {\\n            resolve(wrap(request.result));\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(request.error);\\n            unlisten();\\n        };\\n        request.addEventListener('success', success);\\n        request.addEventListener('error', error);\\n    });\\n    promise\\n        .then((value) => {\\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\\n        // (see wrapFunction).\\n        if (value instanceof IDBCursor) {\\n            cursorRequestMap.set(value, request);\\n        }\\n        // Catching to avoid \\\"Uncaught Promise exceptions\\\"\\n    })\\n        .catch(() => { });\\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\\n    // is because we create many promises from a single IDBRequest.\\n    reverseTransformCache.set(promise, request);\\n    return promise;\\n}\\nfunction cacheDonePromiseForTransaction(tx) {\\n    // Early bail if we've already created a done promise for this transaction.\\n    if (transactionDoneMap.has(tx))\\n        return;\\n    const done = new Promise((resolve, reject) => {\\n        const unlisten = () => {\\n            tx.removeEventListener('complete', complete);\\n            tx.removeEventListener('error', error);\\n            tx.removeEventListener('abort', error);\\n        };\\n        const complete = () => {\\n            resolve();\\n            unlisten();\\n        };\\n        const error = () => {\\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\\n            unlisten();\\n        };\\n        tx.addEventListener('complete', complete);\\n        tx.addEventListener('error', error);\\n        tx.addEventListener('abort', error);\\n    });\\n    // Cache it for later retrieval.\\n    transactionDoneMap.set(tx, done);\\n}\\nlet idbProxyTraps = {\\n    get(target, prop, receiver) {\\n        if (target instanceof IDBTransaction) {\\n            // Special handling for transaction.done.\\n            if (prop === 'done')\\n                return transactionDoneMap.get(target);\\n            // Polyfill for objectStoreNames because of Edge.\\n            if (prop === 'objectStoreNames') {\\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\\n            }\\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\\n            if (prop === 'store') {\\n                return receiver.objectStoreNames[1]\\n                    ? undefined\\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\\n            }\\n        }\\n        // Else transform whatever we get back.\\n        return wrap(target[prop]);\\n    },\\n    set(target, prop, value) {\\n        target[prop] = value;\\n        return true;\\n    },\\n    has(target, prop) {\\n        if (target instanceof IDBTransaction &&\\n            (prop === 'done' || prop === 'store')) {\\n            return true;\\n        }\\n        return prop in target;\\n    },\\n};\\nfunction replaceTraps(callback) {\\n    idbProxyTraps = callback(idbProxyTraps);\\n}\\nfunction wrapFunction(func) {\\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\\n    // only create one new func per func.\\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\\n    if (func === IDBDatabase.prototype.transaction &&\\n        !('objectStoreNames' in IDBTransaction.prototype)) {\\n        return function (storeNames, ...args) {\\n            const tx = func.call(unwrap(this), storeNames, ...args);\\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\\n            return wrap(tx);\\n        };\\n    }\\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\\n    // undefined if the end of the cursor has been reached.\\n    if (getCursorAdvanceMethods().includes(func)) {\\n        return function (...args) {\\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n            // the original object.\\n            func.apply(unwrap(this), args);\\n            return wrap(cursorRequestMap.get(this));\\n        };\\n    }\\n    return function (...args) {\\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\\n        // the original object.\\n        return wrap(func.apply(unwrap(this), args));\\n    };\\n}\\nfunction transformCachableValue(value) {\\n    if (typeof value === 'function')\\n        return wrapFunction(value);\\n    // This doesn't return, it just creates a 'done' promise for the transaction,\\n    // which is later returned for transaction.done (see idbObjectHandler).\\n    if (value instanceof IDBTransaction)\\n        cacheDonePromiseForTransaction(value);\\n    if (instanceOfAny(value, getIdbProxyableTypes()))\\n        return new Proxy(value, idbProxyTraps);\\n    // Return the same value back if we're not going to transform it.\\n    return value;\\n}\\nfunction wrap(value) {\\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\\n    if (value instanceof IDBRequest)\\n        return promisifyRequest(value);\\n    // If we've already transformed this value before, reuse the transformed value.\\n    // This is faster, but it also provides object equality.\\n    if (transformCache.has(value))\\n        return transformCache.get(value);\\n    const newValue = transformCachableValue(value);\\n    // Not all types are transformed.\\n    // These may be primitive types, so they can't be WeakMap keys.\\n    if (newValue !== value) {\\n        transformCache.set(value, newValue);\\n        reverseTransformCache.set(newValue, value);\\n    }\\n    return newValue;\\n}\\nconst unwrap = (value) => reverseTransformCache.get(value);\\n\\n\\n\\n\\n//# sourceURL=webpack://unwiredjs/./node_modules/idb/build/wrap-idb-value.js?\");\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/global */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.g = (function() {\n/******/ \t\t\tif (typeof globalThis === 'object') return globalThis;\n/******/ \t\t\ttry {\n/******/ \t\t\t\treturn this || new Function('return this')();\n/******/ \t\t\t} catch (e) {\n/******/ \t\t\t\tif (typeof window === 'object') return window;\n/******/ \t\t\t}\n/******/ \t\t})();\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \t// This entry module can't be inlined because the eval devtool is used.\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/index.js\");\n/******/ \t\n/******/ })()\n;"
  },
  {
    "path": "264/dist/index.html",
    "content": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>Firebase With Shubham!</title>\r\n\r\n</head>\r\n<body>\r\n\r\n    <form class=\"add\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <select name=\"category\" id=\"\">\r\n            <option value=\"drama\">Drama</option>\r\n            <option value=\"action\">Action</option>\r\n            <option value=\"comedy\">Comedy</option>\r\n        </select>\r\n        <input type=\"submit\" value=\"Add Movie\">\r\n    </form>\r\n\r\n    <form class=\"delete\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Delete Movie\">\r\n    </form>\r\n\r\n    <form class=\"update\" style=\"margin-top: 50px;\">\r\n        <input type=\"text\" placeholder=\"Movie ID\" name=\"id\" autocomplete=\"off\">\r\n        <input type=\"text\" placeholder=\"Name\" name=\"name\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Update Movie\">\r\n    </form>\r\n\r\n    <form class=\"register\" style=\"margin-top: 50px;\">\r\n        <input type=\"email\" placeholder=\"Email\" name=\"email\" autocomplete=\"off\">\r\n        <input type=\"password\" placeholder=\"Password\" name=\"password\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Register User\">\r\n    </form>\r\n\r\n    <form class=\"login\" style=\"margin-top: 50px;\">\r\n        <input type=\"email\" placeholder=\"Email\" name=\"email\" autocomplete=\"off\">\r\n        <input type=\"password\" placeholder=\"Password\" name=\"password\" autocomplete=\"off\">\r\n        <input type=\"submit\" value=\"Login User\">\r\n    </form>\r\n\r\n    <button class=\"logout\" style=\"margin-top: 50px;\">Logout</button>\r\n    \r\n    \r\n    <script src=\"bundle.js\"></script>\r\n</body>\r\n</html>"
  },
  {
    "path": "264/package.json",
    "content": "{\n  \"name\": \"unwiredjs\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"build\": \"webpack\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"webpack\": \"^5.60.0\",\n    \"webpack-cli\": \"^4.9.1\"\n  },\n  \"dependencies\": {\n    \"firebase\": \"^9.8.1\"\n  }\n}\n"
  },
  {
    "path": "264/src/index.js",
    "content": "import { initializeApp } from \"firebase/app\";\r\nimport { getFirestore, collection, getDocs, onSnapshot, addDoc, deleteDoc, doc, query, where, orderBy, serverTimestamp, updateDoc} from \"firebase/firestore\";\r\nimport { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut } from \"firebase/auth\";\r\n\r\n\r\nconst firebaseConfig = {\r\n  apiKey: \"AIzaSyBx7YBvGer7ntu08Z0jE56q6ooI-UZFYps\",\r\n  authDomain: \"notnotion-defa4.firebaseapp.com\",\r\n  projectId: \"notnotion-defa4\",\r\n  storageBucket: \"notnotion-defa4.appspot.com\",\r\n  messagingSenderId: \"63313643087\",\r\n  appId: \"1:63313643087:web:fd1e442f73022ffa660c3a\"\r\n};\r\n\r\n\r\nconst app = initializeApp(firebaseConfig);\r\nconst db = getFirestore();\r\nconst auth = getAuth();\r\n\r\nconst colRef = collection(db, \"movies\");\r\nconst qRef = query(colRef, where(\"category\", \"==\", \"drama\"), orderBy(\"createdAt\"));\r\n\r\n\r\n// const documentReference = doc(db, \"movies\", \"uwmpf5Z4D3N1maXYlfHn\");\r\n// onSnapshot(documentReference, (document) => {\r\n//     console.log(document.data(), document.id);\r\n// });\r\n\r\n\r\ngetDocs(colRef)\r\n    .then(data => {\r\n        let movies = [];\r\n        data.docs.forEach(document => {\r\n            movies.push({...document.data(), id: document.id});\r\n        });\r\n        console.log(movies);\r\n    })\r\n    .catch(error => {\r\n        console.log(error);\r\n    });\r\n\r\n\r\n// onSnapshot(colRef, (data) => {\r\n//     let movies = [];\r\n//     data.docs.forEach(document => {\r\n//         movies.push({...document.data(), id: document.id});\r\n//     });\r\n//     console.log(movies);\r\n// });\r\n\r\n\r\nconst addForm = document.querySelector(\".add\");\r\naddForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    addDoc(colRef, {\r\n        name: addForm.name.value,\r\n        category: addForm.category.value,\r\n        createdAt: serverTimestamp(),\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        addForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst deleteForm = document.querySelector(\".delete\");\r\ndeleteForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n    \r\n    const documentReference = doc(db, \"movies\", deleteForm.id.value);\r\n    deleteDoc(documentReference)\r\n    .then(() => {\r\n            deleteForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst updateForm = document.querySelector(\".update\");\r\nupdateForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n\r\n    const documentReference = doc(db, \"movies\", updateForm.id.value);\r\n    updateDoc(documentReference, {\r\n        name: updateForm.name.value,\r\n        updatedAt: serverTimestamp()\r\n    })\r\n    .then(() => {\r\n        updateForm.reset();\r\n    });\r\n});\r\n\r\n\r\nconst registerForm = document.querySelector(\".register\");\r\nregisterForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n\r\n    createUserWithEmailAndPassword(auth, registerForm.email.value, registerForm.password.value)\r\n        .then(credentials => {\r\n            console.log(credentials);\r\n            registerForm.reset();\r\n        })\r\n        .catch(error => {\r\n            console.log(error);\r\n        })\r\n});\r\n\r\n\r\nconst logoutButton = document.querySelector(\".logout\");\r\nlogoutButton.addEventListener(\"click\", event => {\r\n    signOut(auth)\r\n        .then(() => {\r\n            console.log(\"User Logged Out!\")\r\n        })\r\n        .catch(error => {\r\n            console.log(error);\r\n        });\r\n});\r\n\r\n\r\nconst loginForm = document.querySelector(\".login\");\r\nloginForm.addEventListener(\"submit\", event => {\r\n    event.preventDefault();\r\n\r\n    signInWithEmailAndPassword(auth, loginForm.email.value, loginForm.password.value)\r\n        .then(credentials => {\r\n            console.log(credentials.user);\r\n            loginForm.reset();\r\n        })\r\n        .catch(error => {\r\n            console.log(error);\r\n        })\r\n})"
  },
  {
    "path": "264/webpack.config.js",
    "content": "const path = require(\"path\");\r\n\r\nmodule.exports = {\r\n    mode: \"development\",\r\n    entry: \"./src/index.js\",\r\n    output: {\r\n        path: path.resolve(__dirname, \"dist\"),\r\n        filename: \"bundle.js\"\r\n    },\r\n    watch: true,\r\n}"
  }
]